Arithmetic Formatter testing


I’m currently trying to solve the challenge with the arithmetic formatter, and while my code has been working well with my inputs, the test module seems to find an issue I can’t quite grasp.

My code is here:

It keeps showing errors like this, where expected result und result from my code seem identical, but I cannot fully check it because the message is truncated. Do you have any hints for me?

E       AssertionError: Expected different output when calling "arithmetic_arranger()" with ["3801 - 2", "123 + 49"]
E       assert '  3801      ...    -----    ' == '  3801      ...----    -----'
E         -   3801      123
E         +   3801      123    
E         ?                ++++
E         - -    2    +  49
E         + -    2    +  49    
E         ?                ++++
E         - ------    -----...
E         ...Full output truncated (3 lines hidden), use '-vv' to show

Thank you very much in advance! :slight_smile:

Here in color: They are indeed NOT identical. You code has trailing spaces → that’s what the ?-line is indicating :wink:

Ohh, thank you so much! Looks like I failed at interpreting this exact line. :sweat_smile:

That’s something I can definitely work with, thanks again! :smiley:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.