Hour Glass Pattern Using Python | Python Pattern Using Loop | Learn Python Programming | Python Loop

Hour Glass Pattern Using Python | Python Pattern Using Loop | Learn Python Programming | Python Loop

CodeAsItIs

4 года назад

2,805 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@youngboss9060
@youngboss9060 - 29.03.2022 03:11

i did something similar before watching this vid check it out :)

a = input("enter your first name: ")
print()
for i in range(len(a)):
for j in range(i):
print(' '*len(a),end = '')
for j in range(2*(len(a)-i)-1):
print(a,end='')
if i < len(a)-1:
print()
for i in range(len(a)+1):
for j in range(len(a)-i):
print(end=' '*len(a))
for j in range(2*i-1):
print(a,end='')
print()

Ответить
@Pathaniajimmy
@Pathaniajimmy - 10.05.2022 15:33

🥲

Ответить
@rajeshgoruva4036
@rajeshgoruva4036 - 30.10.2022 00:43

a = int(input())
for i in range(a):
spaces = " " * i
stars = "* " * (a-i)
print(spaces+stars)
for j in range(1,i+1):
spaces = " " * (a-j-1)
stars = "* " * (j+1)
print(spaces+stars)

Ответить