Печать рисунков на Python напротив [закрыто] ⇐ Python
Печать рисунков на Python напротив [закрыто]
num = 5
#count =1
for i in range(num,-1,-1):
spaces = num - i
print(" " * space,end="")
type(spaces)
for j in range(i):
print(j,end="")
# count +=1
# for k in range(1,count,1):
# print(" ",end="")
first i am trying to add spaces using the third loop but in the last i thaught about the lines are wasing so it will take extra memory without the any reason so after that i put my code on copilot he provided me another concept that is " spaces " variable used in code
i got the new way to optimize my code
output:
01234
_0123
__012
___01
____0
Подробнее здесь: https://stackoverflow.com/questions/797 ... posite-way
num = 5
#count =1
for i in range(num,-1,-1):
spaces = num - i
print(" " * space,end="")
type(spaces)
for j in range(i):
print(j,end="")
# count +=1
# for k in range(1,count,1):
# print(" ",end="")
first i am trying to add spaces using the third loop but in the last i thaught about the lines are wasing so it will take extra memory without the any reason so after that i put my code on copilot he provided me another concept that is " spaces " variable used in code
i got the new way to optimize my code
output:
01234
_0123
__012
___01
____0
Подробнее здесь: https://stackoverflow.com/questions/797 ... posite-way
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Как преобразовать объекты холста, сохраняя при этом напротив стороны фиксированной?
Anonymous » » в форуме Javascript - 0 Ответы
- 6 Просмотры
-
Последнее сообщение Anonymous
-