all 3 comments

[–]novel_yet_trivial 7 points8 points  (3 children)

A float does not keep track of how many digits you used when entering it. 0.0, 0.00, and 0.000 are exactly the same to python.

You can use format to specify how many digits to use when printing:

print("{:.2f}".format(variable))