Program to Construct the pattern using for loop

In this program, we will construct the pattern using a nested for loop.

Steps to solve the program
  1. Use for loop with range function to iterate over numbers from 1-5.
  2. Initiate another for loop inside the above for loop to print the number initiated by 1st for lopp times the given in the pattern.
  3. Print the output.
				
					for i in range(1,6):
        for j in range(i):
            print(i,end=" ")
        print()
				
			

Output :

				
					1 
2 2 
3 3 3 
4 4 4 4 
5 5 5 5 5 
				
			

construct the following pattern

get the Fibonacci series between 0 to 10

Leave a Comment