Chapter 1 - Main Ideas

  • Python programs are written in text.
  • Python programs execute line-by-line and similar to English from top to bottom and from left to right.
  • When Python finishes executing the last line of a program, it stops.
  • Empty lines are ignored.
  • The program is always executed as a whole.
  • If an error occurs, the program execution stops and an error message points to what went wrong.
  • The import keyword is used to get access to Python "modules".
    • Example: import player
    • Modules provide access to different functionality.
    • They can be used to organize complex programs.
    • People use modules to share their code with others.
  • Modules provide access to "functions".
    • Example: player.move_forward()