Definition
- Literal:
1 "hi" - Keywords:
True print - Variable
- An expression is a combination of literals, variables and operators
- A statement is a unit of code that the python interpreter can run. A statement can contain 1 or mire expression
- Index 索引
a[3]
Comments
- if you want your comment to span multiple lines, use triple quotes (''' or """)
""" This variable represents
the age needed to obtain a
drivers license in Minnesota. """
mystery_variable = 15
This comment tells the reader the logical purpose of the line of code.
We use a \ to "escape" the single quote:
In [3]: funny_quote = 'There\'s a snake in my boots!'