Scientific Computing with Python Projects - Arithmetic Formatter not passing tests

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/ 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”

This line in .replit should just be:

run = “python3”

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.


Hi! I have the same error to run the test, when I add that command on the shell I just receive this error there is not matter what I choose:

run = python3
run: command not installed. Multiple versions of this command were found in Nix.
Select one to run (or press Ctrl-C to cancel):
Adding run to replit.nix
run: ERROR: runfile ‘Runfile’ not found: please create the file or specify an alternative.

This line goes in the .replit file. You might need to enable show hidden files to see it.

Screenshot 2023-10-02 073220

You can replace that run = line.

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