Arithmetic Formatter Assertion Error

I am having a tough time figuring out why I can’t get rid of the assertion errors. The captured stdout calls all look good. I copied and pasted everything into a text reader and everything lined up there. I think I am misunderstanding something in regard to this error type maybe?

Thanks ahead of time.

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36

Challenge: Scientific Computing with Python Projects - Arithmetic Formatter

Link to the challenge:

You aren’t stripping extra whitespace from the lines in the middle, only the last one

If there was extra whitespace somewhere, wouldn’t it be obvious in that the lines wouldn’t line up? Are you able to point to where this white space is? I guess I’m confused because in the loop any white space I allowed was calculated( lines 36-38) and it doesn’t look any different in the text editor.

Its at the end of the lines.

Edit: looks like you’re closer now!

Thank you for your patience. I am now 90% complete. Is there a method you used to quickly assess the code to figure out what was wrong, or is that an experience thing?

Edit: YES!

1 Like

The diff had a bunch of ++++ above blank space. That means there are extra spaces in the output.

1 Like

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