Hi, I’m new to Python, and I’m having trouble with a Syntaxerror on an Else

Asked

Viewed 62 times

-3

It appears to be written in the right way, but is still making a mistake. No matter what I do the error continues, I have already tried to exchange for an Elif, for an if, but nothing right. Always gives a Syntaxerror.

  • Missing one ) on line above Else.

  • 1

    Hello, parentesis missing in 2nd print.

  • Oops, I didn’t even notice, I ended up looking for the bug only in LSE and I didn’t even see it, thank you

  • It is common with syntax errors - not always where Python fails to understand what is happening is the line that is the problem. Sometimes it is a few lines before. In this case, as the staff commented, missed closing the parentheses in the line above the Else.

  • 2

    And please put the code as text. Putting it as image is not ideal, understand the reasons reading the FAQ.

  • Okay, from now on I only put in codes.

  • 1

    From now on, don’t start with that.

Show 2 more comments

1 answer

0


@Gabrielbellasco, the mistake that is in the "I" is actually before him ! You missed closing the print parentheses. You opened, but did not close !

NOTE:There will be a hint.. whenever accusing a Syntaxerror, look for the error. When you find the same underline as in the example of your program which is "Else", always look in the top row as the error will be in the line above. When you were learning C, you always had these mistakes and you had the same problem ! Here’s a tip to help you program.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.