Please enable JavaScript.
Coggle requires JavaScript to display documents.
PEP 8 (Naming Convention (Function (Use a lowercase word or words.…
PEP 8
Naming Convention
Function
Use a lowercase word or words. Separate words by underscores to improve readability. ex. function, my_function
Variable
Use a lowercase single letter, word, or words. Separate words with underscores to improve readability.
Class
Start each word with a capital letter. Do not separate words with :!:underscores. This style is called camel case.
-
Constant
Use an uppercase single letter, word, or words. Separate words with underscores to improve readability.
Module
Use a short, lowercase word or words. Separate words with underscores to improve readability.
Package
Use a short, lowercase word or words. Do not separate words with :!:underscores.
:warning: Never use l, O, or I single letter names as these can be mistaken for 1 and 0, depending on typeface:
-
Overview
-
-
-
written in 2001 by Guido van Rossum, Barry Warsaw, and Nick Coghlan.
Indentation
Tabs vs. Spaces
-
use the -tt flag, the interpreter will issue errors instead of warnings
-
-
Comments
-
Documentation Strings
-
Surround docstrings with three double quotes on either side, as in """This is a docstring""".
Write them for all public modules, functions, classes, and methods.
-
For one-line docstrings, keep the """ on the same line:
Inline Comments
-
-
-
-
Start inline comments with a # and a single space, like block comments.
-
-
Code Layout
Blank Lines
Vertical whitespace, or blank lines, can greatly improve the readability of your code.
-
-
-
-
-
-
-
-
-