1>>> x = 13.949999999999999999
2>>> x
313.95
4>>> g = float("{0:.2f}".format(x))
5>>> g
613.95
7>>> x == g
8True
9>>> h = round(x, 2)
10>>> h
1113.95
12>>> x == h
13True
1# Some numerical values
2valueA = 3.14159265359
3valueB = 1845.7409947
4valueC = -100.95
5valueD = 9.5432
6valueE = 34.49953
7
8# Round to different decimal places
9roundA = round(valueA, 5)
10roundB = round(valueB, 4)
11roundC = round(valueC, 3)
12roundD = round(valueD, 2)
13roundE = round(valueE, 1)
14
15# Output rounded values
16print("Value:".ljust(15), "Rounded:")
17
18print(str(valueA).ljust(15), roundA)
19print(str(valueB).ljust(15), roundB)
20print(str(valueC).ljust(15), roundC)
21print(str(valueD).ljust(15), roundD)
22print(str(valueE).ljust(15), roundE)
23