Skip to content

Instantly share code, notes, and snippets.

@dasunsucharith
Created May 18, 2022 02:47
Show Gist options
  • Save dasunsucharith/18eba0ee160fcb1ebc1af574673b1337 to your computer and use it in GitHub Desktop.
Save dasunsucharith/18eba0ee160fcb1ebc1af574673b1337 to your computer and use it in GitHub Desktop.
CS50 2022 Psets 6 Mario-less Problem Solution
# TODO
# get input from user until input is correct
while True:
try:
height = int(input("Height: "))
if (height >= 1) and (height <= 8):
break
except:
print("", end="")
spaces = 1
for j in range(height):
# print spaces
for spaces in range(height - j-1):
print(" ", end="")
# print hashes
for i in range(j+1):
print("#", end="")
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment