cs50/mario.py

15 lines
304 B
Python
Raw Normal View History

while True:
try:
height = int(input("Height: "))
if height in range(1, 9):
break
except:
ValueError
space = height - 1
for r in range(height):
print(" " * space + "#" * (height - space) + " " + "#" * (height - space), end="")
print()
space -= 1