My code appears to work, but when it actually runs all the tests it fails them all. I can’t seem to figure out the issue because the output looks normal and only seems incorrect in the test templates.
(boilerplate-arithmetic-formatter-1 - Replit)
Your browser information:
User Agent is:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/188.8.131.52 Safari/537.36
Challenge: Scientific Computing with Python Projects - Arithmetic Formatter
Link to the challenge:
- 3801 123
+ 3801 123
- - 2 + 49
+ - 2 + 49
- ------ -----
+ ------ -----
This is saying that you have extra spaces at the end of those lines
- Error: Operator must be '+' or '-'.
+ Error: Operator must be '+' or '-'..
This is saying that you have an extra
. at the end of the line
TypeError: arithmetic_arranger() takes 1 positional argument but 2 were given
This says that you don’t have an optional second argument to display solutions
Oh thank you so much that makes alot more sense. I thought everything was printing twice and was so confused.
Can you explain the optional second argument to display solutions? I changed my code so everything works besides the sums have the same error message as before, but my code does display the sum.
The function should optionally take a second argument. When the second argument is set to True, the answers should be displayed.
You need to look up arguments with default values for Python
Thank you for all your help!