Код: Выделить всё
*
***
*****
*******
*********
*********
*******
*****
***
*
Код: Выделить всё
length = 10 #This line don't exist normally, its just to avoid the input and every check.
lengthTest = length
answer = lengthTest % 2
if (answer == 0):
length_1 = 1
while (length_1 < length):
print("*" * length_1)
length_1 = length_1 + 2
length_1 = length_1 - 2
while (length_1 > 0):
print("*" * length_1)
length_1 = length_1 - 2
else:
print("odd")
Подробнее здесь: https://stackoverflow.com/questions/418 ... -and-width
Мобильная версия