Skip to the lesson

CodingLesson 2 of 6

Part 1 of 3, 0 done

13 min

The till that remembers: variables

The movie theater's app knows your points the moment you scan in. Here's how a program remembers anything, and how one line changes it.

Ticket 01 · The guess

What's in the box?

The theater's app runs these three lines, top to bottom. What number is in points at the end?

points ← 140
points ← points + 10
points ← 25
100 points
0 points200
Words to know

Spot something wrong?

Tell us what looks off. No name or email needed.

What kind of problem?

0 / 1000

We'll also send this page, the lesson, ticket 1, so we can find it. Nothing else. Privacy

·
Sources and every number

Every number

  • 25 pointsexample (example number: Worked out from the example code: the last line stores the final value.) · Worked out from the example code: the last line stores the final value.
  • 150 pointsexample (example number: Worked out: the starting value plus ten, after line two.) · Worked out: the starting value plus ten, after line two.
  1. Lessons›
  2. The school›
  3. Coding
  • ·Before this: A recipe a computer can follow
  • ·Next: If the cart is fifty dollars or more: business rules
Skip to the lesson

CodingLesson 2 of 6

Part 1 of 3, 0 done

13 min

The till that remembers: variables

The movie theater's app knows your points the moment you scan in. Here's how a program remembers anything, and how one line changes it.

Ticket 01 · The guess

What's in the box?

The theater's app runs these three lines, top to bottom. What number is in points at the end?

points ← 140
points ← points + 10
points ← 25
100 points
0 points200
Words to know

Spot something wrong?

Tell us what looks off. No name or email needed.

What kind of problem?

0 / 1000

We'll also send this page, the lesson, ticket 1, so we can find it. Nothing else. Privacy

·
Sources and every number

Every number

  • 25 pointsexample (example number: Worked out from the example code: the last line stores the final value.) · Worked out from the example code: the last line stores the final value.
  • 150 pointsexample (example number: Worked out: the starting value plus ten, after line two.) · Worked out: the starting value plus ten, after line two.
  1. Lessons›
  2. The school›
  3. Coding
  • ·Before this: A recipe a computer can follow
  • ·Next: If the cart is fifty dollars or more: business rules