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***********'
num_set = set()
x = 1
while x != 0:
x=int(input('введите число '))
num_set.add(x)
num_set.remove(max(num_set))
print(max(num_set))