Ad
  • Custom User Avatar

    Probably because your code returns a wrong answer. If the only thing you did was replacing print with return, then your code only returns a part of the whole string.

  • Custom User Avatar

    If all tests fail with some message similar to Expected 'Something' but got None or something along those lines (depending on language and assertions library used), it might mean that you are printing your answer to standard output instead of returning it from your function. This problem occurs especially often for people who do not understand the difference between printing a value and returning it, or when someone comes from some other competitive programming website which actually requires values to be printed and not returned.

    You're printing the result to the console instead of returning it.

    test.assert_equals(draw_stairs(3), stairs)
                            ^
    #           Your function is returning None                    
    
  • Custom User Avatar