Python can be run interactively, through a script, or in a notebook form.
Use import
to load in Python packages.
Comments are evoked through #
, and docstrings are evoked through """ """
.
Python starts indexing at 0 (zero).
Indentation levels are very important for Python, and 4 spaces should be used for indents. Indent levels are critical for if
statements and for
loops.
if
statements and for
loops should each end the opening line with a :
(colon).
It is a common convention to use non-plural/plural pairs for for
loops.
Updating a variable with addition can be achieved through +=
.
The \
is a line continuation mark, as well as the escape character.
The phrase keyword arguments (for functions) is sometimes shorted to **kwargs
.
Exit command-line Python with quit()
or exit()
, including the parentheses.