1import math
2
3val = 3.14
4math.floor(val) # rounds down --> 3
5math.ceil(val) # rounds up val --> 4
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