Is there something wrong with my arithmetic_arranger arithmetic fomatter code?

My code works as far as I can tell, but it does not pass the tests. I am very confused as to why that is.

Any help will be very much appreciated.

Please let me know if there is a better way for me to display my code/errors.

For a problem like this, you should be trying to look at your string objects directly in the repl. You’ll see that after the for loop the lines have extra white space on the end. You can remove this with line.rstrip().

1 Like

Thank you thank you thank you. This solved it. Have a great day!!!

The output appears to be perfect, and there is no extra whitespace after the lines. Still fails.

Works for any number of problems with positive or negative answers.
[boilerplate-arithmetic-formatter - Replit](https://arrithmetic_arranger() code)

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