1import random
2Variable = round(random.randint(10, 20)/10)*10
3# this will return a random number to the nearest multiple of 10
1>>> import math
2
3>>> math.ceil(1.2)
42
5
6>>> math.ceil(2)
72
8
9>>> math.ceil(-0.5)
100
11
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