Tools for fixing coding style violations
Note that we have formatting tools such as Black (https://black.readthedocs.io/en/stable/), isort (https://pycqa.github.io/isort/), and/or Ruff (https://docs.astral.sh/ruff/) that can help you fix code that does not follow the style guide recommendations. We are not going to spend time on how to use these tools here since you can find all the needed documentation on their official documentation pages and start using them in a matter of minutes.
Now, let’s explore our selected code style recommendations.
Indentation
You should use four spaces per indentation level, and you should avoid mixing tabs and spaces.
Maximum line length and blank lines
The style guide recommends limiting all lines of code to a maximum of 79 characters, for better readability.
Also, there are rules related to blank lines. First, you should surround top-level function and class definitions with two blank lines. Second, method definitions inside...