Inverted pyramid pattern of numbers
An inverted pyramid is a downward pattern where numbers get reduced in each iteration, and on the last row, it shows only one number. Use reverse for loop to print this pattern.
1
Expert's answer
2021-09-24T18:58:12-0400
n = int(input())
for i in range(n,0,-1):
for j in range(n-i):
print(' ', end='')
for j in range(2*i-1):
print(i,end='')
print()
Comments
Leave a comment