1
2# Generating Hollow Pyramid Pattern Using Stars
3
4row = int(input('Enter number of rows required: '))
5
6for i in range(row):
7 for j in range(row-i):
8 print(' ', end='') # printing space required and staying in same line
9
10 for j in range(2*i+1):
11 if j==0 or j==2*i or i==row-1:
12 print('*',end='')
13 else:
14 print(' ', end='')
15 print() # printing new line
16