If you need to get a random number in python, and it just needs to be an integer, try importing
randint from the random library and then using the inclusive bounds. For instance, if you want numbers between 1 and 6 for a six-sided die, the parameters are simply
a <= x <= b, so simply 1 and 6. How intuitive.
from random import randint def get_die(): die = randint(1,6) return die
When I learned python years ago, I was scared by the mountain of libraries available.