

InterviewSolution
Saved Bookmarks
1. |
Write a program that will accept the number of Rows from the user to print pattern |
Answer» Code - rows = int(input("ENTER the number of rows: ")) # OUTER loop will print number of rows. for i in range(rows+1): # INNER loop will print the value of i after each iteration. for j in range(i): print(i, end=" ") # print number. # line after each row to display PATTERN correctly. print(" ") |
|