By Ryan Wiles
Insert A high-level overview of the Python Language
Discuss the Philosophy and what it means to write pythonic code
Flow control Defines the Control Blocks
Spaces vs Tabs
https://www.python.org/dev/peps/pep-0008/#indentation Use spaces, not tabs 4 spaces per indention
Alignment: Hanging Indents:
https://www.python.org/dev/peps/pep-0008/#indentation
Aligned with opening delimiter
Should always add a level over the immediately following indentation level
https://www.python.org/dev/peps/pep-0008/#whitespace-in-expressions-and-statements
https://www.python.org/dev/peps/pep-0008/#when-to-use-trailing-commas
A single expression per line is preferred, the default expression terminator is the new line character
Multiple expressions are supported using semicolons as the separator
An expression can span multiple lines using the following mechanisms:
A backslash ‘' immediately before the new line character continues the expression to the next line.
This style is generally frowned upon.
Examples of Exceptions to the Rule:
Long statements with multiple "with" statements
Assert statements
For statements containing '(', '{', or '[', the expression will continue across new lines until all matching
closing parantheses, braces, or brackets have been processed.
Aligning the closing parantheses, braces, and brackets
Non-Comment (i.e. Code) lines should not exceed 79 characters Comment & Docstring lines should be limited to 72 characters
https://www.python.org/dev/peps/pep-0008/#naming-conventions
https://www.python.org/dev/peps/pep-0008/#prescriptive-naming-conventions
http://www.cse.msu.edu/~cse231/General/NamingConventions.pdf
https://www.python.org/dev/peps/pep-0008/#package-and-module-names
“Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability.”
https://www.python.org/dev/peps/pep-0008/#package-and-module-names
“Python packages should also have short, all-lowercase names, although the use of underscores is discouraged.”
Module is the name that python gives to https://docs.python.org/3/tutorial/modules.html
Default Global Variables
__name__: This is automatically set to the module’s name.
Module Level Dunder Names
https://www.python.org/dev/peps/pep-0008/#module-level-dunder-names
Structure:
Structure:
https://www.python.org/dev/peps/pep-0008/#comments
Comments:
Docstrings:
Lambda Expressions:
Example of Fibonacci using Trapolining & Generators
Quoting (Single Quote vs Double Quote)
Object Oriented Programming in Python 3
Boolean Logic:
Comparision Operators:
Function Annotations: Decorators:
© 2018 Ryan Wiles