DEV Community

Nilotpal Choudhury
Nilotpal Choudhury

Posted on

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

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…

Discussion (0)