Program to generate random numbers.

In this python basic program, we will generate random numbers using random library.

Steps to solve the program
  1. Import random library.
  2. We are going to generate 5 random numbers, so use for loop with range function to generate 5 number.
  3. Use random.random() to generate random numbers inside the loop.
  4. Print the output.
				
					import random

for i in range(5):
    print(random.random())
				
			

Output :

				
					0.9199240457263513
0.9004451014782473
0.7153068440492277
0.6578686372362937
0.9954018599145891
				
			

check for the anagram.

generate a random string with a specific length.

Leave a Comment