Write program to print the pattern

take user input of a number, i.e., the number of rows.

Example: rows = 5

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

1 Like

r = int(input(“Enter the number”))
for i in range(1, r+1):
for j in range(1, i+1):
print(j, end=" “)
print(”\n")