Scientific Computing with Python Projects - Arithmetic Formatter not passing tests

Hi’
so i think i’ve done everything right but i keep failing all of the tests on replit although the results are exactly as they should be .

Your code so far
boilerplate-arithmetic-formatter - Replit

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 Edg/116.0.1938.76

Challenge: Scientific Computing with Python Projects - Arithmetic Formatter

Link to the challenge:

You should not print the errors. As soon as you encounter an error condition, you need to return the error string.

Also, it looks like you are adding extra spaces at the end of each line.

run = “run = python3 main.py”

This line in .replit should just be:

run = “python3 main.py”

1 Like

thank you so much
i just passed 4 of the test that are probably related to errors; but i still am failing 6 of them :frowning:

As Jeremy mentioned you have some extra spaces at the end of your lines:

AssertionError: Expected different output when calling "arithmetic_arranger()" with ["3801 - 2", "123 + 49"]

'  3801      123    \n-    2    +  49    \n------    -----    \n'
'  3801      123\n-    2    +  49\n------    -----'

First it shows your output, then the expected output. You can see how you have extra space between 123 and \n

1 Like

oh so thats why it didn’t work, i just gave up on that and used the shell window instead, which does the same job.
thank you for that.

1 Like

oh, thats because i put 4 spaces at the end of all the problems, i should remove the last one.
thanks

2 Likes