You already got your answer, but don't seem to know what modulus is doing. It is the remainder of integer division of the left operand by the right operand. Knowing this, it's obvious that you'll never get the right hand operand as a result.
Lee.... I did know what modulus was. I covered that in the book a few weeks ago and use it to find Prime numbers. That begin said, I did miss the % in this line of code and it's meaning.
Now that being said, I am confused why you need the Modulus to find the remainder when you are trying to get a random number? When I learned Python it was simple "random.randrange(1,10)"
So why do you need to use the Modulus? and how then would you select a random number from say 5 to 10?
Thanks again for pointing that out Lee so I can understand it.