Back
I want a random number between 0 and 1, like 0.3452. I used random.randrange(0, 1) but it is always 0 for me. What should I do?
To generate a random number between 0 and 1 in Python you can use random.uniform:-
import random random.uniform(0, 1)
import random
random.uniform(0, 1)
31k questions
32.8k answers
501 comments
693 users