cs50/mario.py

16 lines
289 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, end="")
print("#" * (height - space), end="")
print()
space -= 1