Python program to generate a random float where the value is between 5 and 50 using Python math module.
Code:
import random
print("Float values between 5 to 50")
for x in range(5):
print('{:04.3f}'.format(random.uniform(5, 50)), end='\n')
Output:
Comments
Post a Comment