Definition

  1. Literal: 1 "hi"
  2. Keywords: True print
  3. Variable
  4. An expression is a combination of literals, variables and operators
  5. A statement is a unit of code that the python interpreter can run. A statement can contain 1 or mire expression
  6. Index 索引 a[3]

Comments

  1. 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!'

results matching ""

    No results matching ""