How to transform a float 50.0 into an int 50 in Python?
i need a function that should looks like this:
>>> a = 5.0 >>> integer(a) >>> 5
Just make it an int:
And don't call the variable the same name as the module, otherwise you can't access the module anymore. That's why I used r instead.
That said, your comparison should work anyway, because Python is smart:
>>> 5.0 == 5 True
Finally, since you apparently want a multiple of 10 from 0 to 90, I'd just do this:
int(random.random() * 10) * 10