There are several decimal places to retain a good use of the function round
, any float can leave to the specified number of digits.
E.g
a=3.1415926535
print(round(a,3))
#输出为3.142
Obviously the result is automatically rounded.
If we direct round (a), it returns an integer
a=3.1415926535
print(round(a))
#输出为3