How can I generate random integers between 0 and 9 (inclusive) in Python?
For example, 0, 1, 2, 3, 4
0
1
2
3
4
import random print(random.randint(0,9))
random.randint(a, b)
Return a random integer N such that a <= N <= b.
Docs: https://docs.python.org/3.1/library/random.html#random.randint