FAQ: Errors in Python - Syntax Errors

This community-built FAQ covers the “Syntax Errors” exercise from the lesson “Errors in Python”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Analyze Financial Data with Python
Build Chatbots with Python
Build Python Web Apps with Flask

Learn Python 3

FAQs on the exercise Syntax Errors

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!
You can also find further discussion and get answers to your questions over in Language Help.

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head to Language Help and Tips and Resources. If you are wanting feedback or inspiration for a project, check out Projects.

Looking for motivation to keep learning? Join our wider discussions in Community

Learn more about how to use this guide.

Found a bug? Report it online, or post in Bug Reporting

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

After finding and correcting all the syntax errors, the platform doesn’t allow you to progress and still states that the third error (the closed parentheses) needs to be put in, despite already being present.

2 Likes

I am facing the same problem, I checked the solutions and they don’t show any difference between the solution code and my corrected code.
I guess i’ll just replace my solution with theirs and proceed.

1 Like

same here! it is so annyoying!

The SyntaxError is not found in line 15 but actually in line 14

2 Likes

Why did Python define error on line 15 instead of 14? Shouldnt be the error in syntax of print function?

1 Like

Very tricky. Missing “)” in previous line.

This is my question as well. I think it’s just a flaw in Python itself. I’m guessing you could put some kind of statement within the parentheses, such as a string or boolean that goes on multiple lines, but an operation would not be allowed. It therefore assumes you made an error by putting an operator there, rather than not closing a parentheses. This is terrible error design and not very human, but that would be the logic. There are not that many error types, after all, so they’re not very descriptive. This would be why “75% of programming is debugging.”

@afreecompany @cgrey.gt I think that’s a very good interpretation of what happened and one very noted flaws of Python interpreter. When the interpreter points out the errors take it as a general location and look around rather than a precise guide. This is true in most other languages, as well.

1 Like

I find that the Python language has an intuitive syntax, which makes the code structure clear and readable