row_len = int(input("Enter the length of the pyramid: "))
col_len = row_len*2 - 1 # calculate the maximum number of columns, depending on the row_len
for row in range(row_len):
nb_whitespaces = col_len//2 - row # calculate number of whitespaces that should be prints at first of each row
nb_asterisk = row+1 # calculate how many Asterisk that should be prints for each row
print(nb_whitespaces * " " + "* " * nb_asterisk)
# By Omar Alanazi
row = int(input("Enter number of row = "))
for r in range(row):
for s in range(row-r-1):
print(end=" ")
for str in range(r+1):
print("*", end=" ")
print()
# Generating Hollow Pyramid Pattern Using Stars
row = int(input('Enter number of rows required: '))
for i in range(row):
for j in range(row-i):
print(' ', end='') # printing space required and staying in same line
for j in range(2*i+1):
if j==0 or j==2*i or i==row-1:
print('*',end='')
else:
print(' ', end='')
print() # printing new line