Try random.randrange:

from random import randrange
print(randrange(10))