So my program works (or at least I think it does, the output is what I expect to see), but when I use check50 it's still giving me a few errors.

The code is here: https://gist.github.com/anonymous/55da24038d5028955127fd93d5f68cfd

And the error statements it shows me are:

:( handles a height of 1 correctly  
   \ expected output, but not "                      ##\n"  
:( handles a height of 2 correctly  
   \ expected output, but not "                      ##\n             ..."

and this one too :

:( rejects a height of 24, and then accepts a height of 2  
   \ expected output, but not "                      ##\n             ..."

I think the last one's just because there's some sort of error with the input value of 2.

Help, please? Can't figure out what's wrong.

1 Answer 1


check50 expects exact output. Anything extra or missing, including spaces, punctuation characters, line feeds, white space, etc., will result in a fail.

The pset requires the pyramid to be written so that the base of the pyramid starts with a hash in the first column. Your code simply prints the hashes so that the right edge is in column 24 no matter what the height. A myramid of height 1 should not have any leading spaces.

You need to rewrite your code so that the pyramid starts in column 1 at it's base. See the instructions for more details.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

You must log in to answer this question.

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