Created
May 18, 2022 02:47
-
-
Save dasunsucharith/18eba0ee160fcb1ebc1af574673b1337 to your computer and use it in GitHub Desktop.
CS50 2022 Psets 6 Mario-less Problem Solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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