A variable is a named computer memory space that stores a value. The action of putting a value into a variable is called assignment . We use visualization to help us understand how Python executes an assignment statement. We also continue our discussion from last lecture on types, including conversion between types.

Lecture Prep

Watch:
  1. String Expressions (6 minutes)
  2. Expressions and Order of Operation (5 minutes)
    NOTE: There is a mistake in the video. Exponentiation has higher precedence than the unary operators.
  3. Mixed Expression (5 minutes) What happens when we use an operation to combine expressions of different types?
  4. Concept of a Variable (2 minutes) A variable stores a value.
  5. Assignment Statements (3 minutes) To create a variable, assign a value to it.

Or Read: 2.1 - 2.3, 2.5, 2.6


Lecture Materials

Slides: individual slides for viewing , 6-up layout for printing have been updated to include lab passwords for this week

You will need pencil and paper (or stylus and tablet) during lecture for drawing diagrams. We recommend that you print out the slides so that you can write and draw on them. Or have the pdf downloaded so that you can annotate on the pdf. Of course, you can take notes in a notebook, too! The key is to take notes for yourself for easy reference later.

Questions and Answers: check the answers after you try them on your own!

Link to Lecture Recording