Random number between 0 and 1?

Total
0
Shares

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?


Solution

You can use random.uniform

import random
random.uniform(0, 1)

Source: StackOverflow.com

Leave a Reply

Your email address will not be published. Required fields are marked *