Hollow Inverted Full Pyramid - 2
Given the number of rows N, write a program to print the hallow inverted full pyramid pattern similar to the pattern shown below.
1 2 3 4 5
1 4
1 3
1 2
1
N = int(input("Enter the Number: "))
for i in range(1, N+1):
for j in range(0, i):
print(" ", end="")
for j in range(1, (N*2 - (2*i - 1))+1):
if i == 1 or j == 1 or j ==(N*2 -(2*i-1)):
print(j, end="")
else:
print(" ", end="")
print()
Comments
Leave a comment