samedi 9 mai 2015

python: how to transform a float 50.0 into an int 50?

I am using this line of code to generate a random list rounded in dozens:

random = round(random.randrange(0, 100)/10)*10
if random == 5:
    do something

With this code i know i always get a x.0 number. (x = random number) how to make random = x? (without ".0")

Thanks




Aucun commentaire:

Enregistrer un commentaire