LessonPort Python Variable LabAP Computer Science · Variables & assignments
SCORE0STREAK0

PYTHON FOUNDATIONS

Give data a name.
Watch the value change.

A variable is a name that refers to a value. An assignment statement evaluates the expression on the right of =, then stores that result under the name on the left.

Learning target Trace, create, and explain Python variable assignments and reassignments.

GUIDED LESSON · LINE 1 OF 5

Predict, then execute

Read the highlighted line. Predict the value that will be stored, then run it to update memory.

program.pyLines run from top to bottom
1score = 10
2bonus = 5
3score = score + bonus
4player = 'Ada'
5passed = score >= 12
1
Before Python runs line 1, predict the result.What value will score store immediately after this line?