random number generator in range python code example Example: random number pythn import random n = random.randint(0,22) print(n) # Output: 2