27.WAP to display following pattern
CODE:
n=int(input("How many rows\n"))
for i in range(1,n+1):
for j in range(i,0,-1):
print(j,end=" ")
print()
OUTPUT:
How many rows
5
1
2 1
3 2 1
4 3 2 1
5 4 3 2 1
CODE:
n=int(input("How many rows\n"))
for i in range(1,n+1):
for j in range(i,0,-1):
print(j,end=" ")
print()
OUTPUT:
How many rows
5
1
2 1
3 2 1
4 3 2 1
5 4 3 2 1
Comments
Post a Comment