@Ankita ,This is very simple ,just use the random.randint(x,y):
It returns random integers M such that randrange(x,y+1) , where x <= M <= y .
Use this code to generate random int between 0 to 9:
from random import randint
print(randint(0, 9))
Hope this answer helps.