My code is getting 9/9 on the check. Visually it seems fine as well. There doesn't seem to be any preceding or trailing empty spaces. The score, however, is 90%. Any help in identifying the mistake would be greatly appreciated. Here's the code:

from cs50 import get_int

while True:
    height = get_int("Height: ")
    if 1 <= height <= 8:
        for i in range(height):
            print(" " * (height - (i + 1)), "#" * (i + 1), sep="") #https://stackoverflow.com/questions/12700558/print-without-space-in-python-3

Edit for other readers: Please see DinoCoderSaurus' response. Here's a screenshot from style50. enter image description here

1 Answer 1


From the CS50 syllabus:

Problems are evaluated along axes of correctness (as determined by a program called check50) and style (as determined by a program called style50), with scores ordinarily computed as 3 × correctness + 1 × style.

Since correctness looks to be 100%, verify the style portion with style50.

  • TIL style50 doesn't like in-line commenting for Python. I am modifying my question to include a screenshot for other users. Thanks, DinoCoderSaurus - this is getting to be a habit. I have upvoted ad accepted your response.
    – user3671
    Jun 3, 2020 at 13:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .