Write a Python program to print the square of the right increment numbers pattern using for loop.
rows = int(input("Enter Square of Right Increment Numbers Rows = ")) print("====The Square of Right Incremented Numbers Pattern====") for i in range(1, rows + 1): for j in range(1, rows - i + 1): print(1, end = ' ') for k in range(1, i + 1): print(i, end = ' ') print()
This Python program prints the square pattern of increment numbers from the right side using a while loop.
rows = int(input("Enter Square of Right Increment Numbers Rows = ")) print("====The Square of Right Incremented Numbers Pattern====") i = 1 while(i <= rows): j = 1 while(j <= rows - i): print(1, end = ' ') j = j + 1 k = 1 while(k <= i): print(i, end = ' ') k = k + 1 print() i = i + 1
Enter Square of Right Increment Numbers Rows = 9
====The Square of Right Incremented Numbers Pattern====
1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 2 2
1 1 1 1 1 1 3 3 3
1 1 1 1 1 4 4 4 4
1 1 1 1 5 5 5 5 5
1 1 1 6 6 6 6 6 6
1 1 7 7 7 7 7 7 7
1 8 8 8 8 8 8 8 8
9 9 9 9 9 9 9 9 9