Random float number using uniform() in Python

  • Import the random module of Python.
  • Then, call the uniform(x,y) function to get a random float value within the given range and store it in the variable n.
  • Print the randomly generated number.

CODE

import random 
number = random.random()
print("Your random number is:", number)  


OUTPUT
Your random number is: 0.4351727311439526

Leave a Comment

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

Scroll to Top