PEP 8: Python style guide

1.1 The PEP 8 style guide

PEP stands for Python Enhancement Proposals. It states:

  1. Use 4 spaces per indentation level. 🐍
  2. Python disallows mixing tabs and spaces for indentation. 🐍
  3. The use of blank lines: no more than TWO. 🐍
  4. The use of white spaces. 🐍
  5. Naming conventions. 🐍

1.2 Error message reading and handling

As a sidenote, I find it useful to talk about debugging information, although it is not part of the style guide. So if you write in your exception_example.py:

You will see the following error message when you run your script:

Here is a great introduction that you should read: Understanding the Python Traceback.

Example 1.1

Read more.

Back⏎