i have trouble with the height value : when i enter Height of 1 or 25 (where Height must be higher than 1 and not higner than 23), it does print the error message but it also print the pyramid. What i am doing wrong, that the break doesn't work ? tks
Here the error :
~/workspace/pset6/ $ python mario.py
HeightHere is the error : 25
enter Height value between 1 and 23
~/workspace/pset6/ $ python mario.py
Height: 25
enter Height value between 1 and 23
##
###
####
etc.....
Here is the code import cs50
def main(): print("Height: ", end="") Height = cs50.get_int()
import cs50
def main():
print("Height: ", end="")
Height = cs50.get_int()
while True:
if Height > 1 or Height < 23:
print("enter Height value between 1 and 23")
break
for i in range (Height):
print(" "*(Height-i-1), end="")
print("#"*(i+2), end=")
# print newline
print()
if __name__ == '__main__':
main()
if name == 'main': main()