Generate the pattern in python programming
Attachments:
Answers
Answered by
4
Answer:
Pattern - 1: Number Pattern
1 rows = int(input("Enter the number of rows: "))
2 # Outer loop will print number of rows.
3 for i in range(rows+1):
4 # Inner loop will print the value of i after each iteration.
5 for j in range(i):
6 print(i, end=" ") # print number.
7 # line after each row to display pattern correctly.
8 print(" ")
Answered by
33
Similar questions