|||*
||***
*****
||***
|||*
n = int(input())
for i in range(1, n+1, 2):
print('*' * i)
for i in range(n-2, 0 ,-2):
print('*' * i)
5
*
***
*****
***
*
from itertools import chain
N = 7
for n in chain(range(1, N + 1, 2), range(N - 2, 0, -2)):
print(f'{{:^{N}}}'.format('*' * n))
# print('{{:^{}}}'.format(N).format('*' * n))
>>> '{:<30}'.format('left aligned')
'left aligned '
>>> '{:>30}'.format('right aligned')
' right aligned'
>>> '{:^30}'.format('centered')
' centered '
>>> '{:*^30}'.format('centered') # use '*' as a fill char
'***********centered***********'