I am interested in only a selection of random number ,
in this case X % 5 == 0
.
from random import randint
num = randint(5,15000) #Inclusive
while not (num % 5 == 0):
num = randint(5,15000)
print num
here is what I have so far, but this does not seem like it's very pythonic.
Any suggestions?
Thanks
Aucun commentaire:
Enregistrer un commentaire