Sławomir Kwiatkowski

by: Sławomir Kwiatkowski

2024/06/29

Basics of Exception Handling in Python

Content description:

  1. Python exception handling
  2. Hierarchy of exceptions
  3. Optional blocks: else and finally

 

Errors that show up during the execution of the program and are not syntax errors belong to the so-called exceptions.

You can handle these exceptions by putting code that can cause an exception in a try block, and the code to handle the exception in the except block:

Basics of object-oriented programming in Python

  1. How to create objects in Python
  2. Inheritance and multi-inheritance
  3. Extending method code
  4. Overriding method code
  5. Init() method
  6. Class variables
  7. Class methods, constructor overloading
  8. Static methods

 

Let's take a class called Person as an example. By convention, a class name should start with a capital letter, and in the case of a name consisting of many words, we use Pascal formatting - all words written together and starting with a capital letter. The basic class definition is as follows: