1
2
3
4
5
6
7
8
9
10
11
12
13
14
>>> a=0.1
>>> b=0.2
>>> a+2
2.1
>>> a+b
0.30000000000000004
>>> a+b
0.30000000000000004
>>> a+b
0.30000000000000004
>>> print(type(a))
<class 'float'>
>>> print(type(b))
<class 'float'>

最后有个4是因为浮点精度