1,234
edits
Changes
→INVESTIGATION 2: Exceptions and Error Handling
= INVESTIGATION 2: Exceptions and Error Handling =
:Running into errors in programming will be a common occurrence. You should expect that it will happen for any code that you write. In python when an error occurs, the python runtime raises an '''exception'''. These exceptions are raised when python is no long able to handle what the code is trying to do. This section will give the programmer the ability teach you to catch these exceptions when they happen and to allow the program to continue running, or to stop program execution with a readable error message.
== PART 1 - Handling Errors ==
There is a <u>massive amount</u> of exceptions. On the other hand, online Online references can be useful. If you are searching for a specific common exception check out the [https://docs.python.org/3/library/exceptions.html#exception-hierarchy Python Exception Documentation.]
In this section, we will provide examples of how to handle a few exceptions when creating Python scripts.