My code passes all tests of
check50 cs50/2018/x/sentimental/mario/more except this one:
rejects a height of 24, and then accepts a height of 2 expected " # #\n## ##\n", not ""
I have checked multiple times myself and each time it rejects 24 and shows the correct output for 2, yet I cannot figure out why
check50 cannot detect the correct output!
Here's my code:
while True: h = int(input("Height: ")) if h >= 0 and h < 24: break for i in range(h): # printing blank spaces in the same row for w in range(h - (i + 1)): print(" ", end="") # printing blocks in the same row for b in range(i + 1): print("#", end="") print(" ", end="") # printing blocks in the same row for b in range(i + 1): print("#", end="") # moving down to the next row print()
I cannot figure out what is wrong with my code here or is it a bug in