Skip to content

The PEP8 Python style guide

When you write code, you should adhere to the conventions of the programming language you use.

If you learn the right naming and formatting conventions right from the start, it will be easier to read code written by other people, and people will find your code easier to read.

Python defines its conventions in the PEP8 style guide. PEP stands for Python Enhancement Proposals and it’s the place where all Python language enhancements and discussions happen. There are a lot of PEP proposals, all available at https://www.python.org/dev/peps/.

PEP8 is one of the first ones, and one of the most important, too. It defines the formatting and also some rules on how to write Python in a “pythonic” way.

You can read its full content here: https://www.python.org/dev/peps/pep-0008/ but here’s a quick summary of the important points you can start with:

→ Download my free Python Handbook!

THE VALLEY OF CODE

THE WEB DEVELOPER's MANUAL

You might be interested in those things I do:

  • Learn to code in THE VALLEY OF CODE, your your web development manual
  • Find a ton of Web Development projects to learn modern tech stacks in practice in THE VALLEY OF CODE PRO
  • I wrote 16 books for beginner software developers, DOWNLOAD THEM NOW
  • Every year I organize a hands-on cohort course coding BOOTCAMP to teach you how to build a complex, modern Web Application in practice (next edition February-March-April-May 2024)
  • Learn how to start a solopreneur business on the Internet with SOLO LAB (next edition in 2024)
  • Find me on X

Related posts that talk about python: