'''
Задание 2.6.
Дополните код из предыдущего задания так,
чтобы вместо лесенки получалась пирамида.
То есть каждая ступень состоит из чисел от 1 до i и обратно.
Например, для n = 3:
1
12
123
123
12
1
'''
user = int(input(''))
result = 0
number = 0
while user > number:
number += 1
result *= 10
result += number
print(result)
while result > 0:
print(result)
result //= 10
To embed this project on your website, copy the following code and paste it into your website's HTML: