Hello,
my name is Adam, I am total beginner to Python and I trying to get practice in Python.
I am now struggling with the Arithmetic Formatter Project. I think I am on the right way but it keeps returning errors. As I am not familiar with the unit testing at all, I kindly ask you for a support, where should I do the changes in the code.
I would be really appreciated for any help.
Link here: https://repl.it/join/ilmkoxco-adamjurk
Thank you very much.
Hello! Welcome to the community !
-
Problem: indentation. On repl.it, it tells you where the problem is so you can fix it (select the code and then press Shift + Tab to remove a level of indentation).
-
The
continue
keyword. Thecontinue
keyword skips the current iteration and proceeds to the next. In essence, you’re skipping every iteration that’s not an error. -
The next shouldn’t be an issue, but the unit tests are a little strict. When an operator, other than + or -, is used, then you need to return
Error: Operator must be '+' or '-'.
instead ofError: Operator must be "+" or "-".
(single vs double quotes, see? Hard to spot).
Hello,
thank you for the welcome.
I have checked the indentation and I did some adjustments but still the output is wrong.
I am kinda stuck right now as I do not see what to change in order to pass.
Could you please have a look again onto it?
Link is the same.
Thank you very much.
I checked, and you fixed the issues above, but now your problem is that you’re not doing anything with arranged_problems
except replacing the results (instead of appending), which turns out to be just the last problem.
Use this tool to see what exactly your code is doing: Python Tutor code visualizer: Visualize code in Python, JavaScript, C, C++, and Java
Hope it helps !