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