Generate random integers between 0 and 9
Try random.randrange
:
from random import randrange
print(randrange(10))
Try random.randint
:
import random
print(random.randint(0, 9))
Docs state:
random.randint(a, b)
Return a random integer N such that a <= N <= b.