print format python

>>> x = 13.949999999999999999
>>> x
13.95
>>> g = float("{:.2f}".format(x))
>>> g
13.95
>>> x == g
True
>>> h = round(x, 2)
>>> h
13.95
>>> x == h
True

Here is what the above code is Doing:
1. We create a float with a value of 13.949999999999999999.
2. We print the value of the float.
3. We create a new float by using the format() function.
4. We print the value of the new float.
5. We compare the two floats to see if they’re equal.
6. We create a new float by using the round() function.
7. We print the value of the new float.
8. We compare the two floats to see if they’re equal.

As you can see, the two floats are equal.