Getting error message for syntax

Tell us what’s happening:
Describe your issue in detail here.
I am getting an error message in my repl console saying its syntax error but There is no syntax mistake.

Your code so far

My repl file link with code done so far :
boilerplate-arithmetic-formatter-5 - Replit

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 11; SM-A107F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.79 Mobile Safari/537.36

**Challenge: boilerplate-arithmetic-formatter-5 - Replit ** Arithmetic Formatter

There is no “visible” syntax error - but the following line is not indented, so the for-loop is missing a body. Kinda hard for the error to point at something that isn’t there.

Oh I see, I guess, I need to delete the line and key in again right?

You need to adjust indentation to fit your logic - because indentation levels are part of the Python-syntax. Whereas it’s just for the looks in other languages, for Python there is a difference if a line starts with 0 or 1 space for example.

I did some corrections but still error coming up.

First error:

-     3   3801   45   123
+     3      3801      45      123
?      +++          +++  +++
- + 855 -    2 + 43 +  49
+ + 855    -    2    + 43    +  49
?       +++       +++     +++

Your output is red, expected is green, “?” indicates differences. You are supposed to have 4 spaces inbetween each problem - however looking at the operator, there is only one space.

As for the second error, if the “answer” argument is True, you don’t actually reach the “return” → if you read the error, it’ says “None = [stuff]” with “None” being your output or the lack thereof.
Your output is on the left and if you read the message, you’ll notice the assertEqual(actual, expected, “Error message…”), which you can also check out in the test_module.py :wink:
Understanding the error messages is quite challenging at first, but it’s super helpful once you can.

It looks like you have an unclosed parenthesis. See of checking line 39 will help.

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