Answer: Python: Generate random number between x and y which is a multiple of 5 [duplicate]

nilotpalc profile image Nilotpal Choudhury ・1 min read

If you don't want to do it all by yourself, you can use the random.randrange function.

For example import random; print random.randrange(10, 25, 5) prints a number that is between 10 and 25 (10 included, 25 excluded) and is a multiple of 5. So it would print 10, 15, or…


Editor guide