FAQ: Learn Python: Syntax - Errors


#1

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

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

Computer Science
Data Science

FAQs on the exercise Errors

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

Ask or answer a question about this exercise by clicking reply (reply) below!

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

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

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!


#2

Hi there,
If there is an error in the Python code - why does the whole program shut down? and notify of a possible error?
In the example here there are two print() commands. If one is valid but the other is not the console only displays an error and does not ‘print’ the correct result.
Thanks in advance.


#3

If something goes wrong in some sequence of steps that rely on each other, then there’s no meaningful way to continue, you want that to stop.
If it’s a bug then fix the bug.
If something was wrong about the outside world, then you might ignore the request that causes something to go wrong, and continue with the next one. Example: permission denied when opening a file -> don’t open that file, continue with next file, assuming that they are independent units of work and that it makes some kind of sense to continue.