Intro to Python

Programs and Statements

  1. Define the following terms:
  2. State the order of operations used by Python for evaluating arithmetic operators.

  3. Parse a Python statement involving arithmetic using the correct order of operations.

  4. Explain what it means to read a mathematical statement “from the inside out”.

Variables and Comments

  1. Define the following terms:
  2. Identify the comment character used in Python.

  3. Use comments appropriately to explain code and define variables.

  4. Explain:
  5. Use comments to give the units of a variable (where appropriate).

Numbers and Data Types

  1. Compare and contrast mathematical types of numbers and computer types of numbers.

  2. State the 3 types of numbers native to Python.

  3. Use type() to determine the type of a variable.

Functions and Packages

  1. Define the following terms, all in the context of programming:
  2. Distinguish between defining a function and calling a function.

  3. State the syntax for calling a function in Python.

  4. Import a Python package using import.

  5. Import particular function from a Python package using from * import *.

  6. Access a function from an imported package.

Lines, Indentation, and Other White Space

  1. Define the following terms:
  2. Compare and contrast how Python uses whitespace at the beginning of a line versus in the body of a line.

  3. Use appropriate coding style with whitespace to make code legible.

  4. Explain how Python uses indentation to distinguish blocks of code.

  5. Use 4 spaces to denote a given level of indentation in blocks of code.