0Pricing
Coding for Kids · Lesson

Changing a Value

Update what a variable remembers.

Change the Box! 🔄

Here is something cool: you can change what is inside a box anytime!

Take the old thing out, put a new thing in. Like swapping toys! 🧸

box = "apple"
box = "banana"
print(box)

Out With the Old 📤

When you put something new in a box, the old thing leaves!

The box only keeps the newest thing. Bye-bye old value! 👋

snack = "chips"
snack = "cookies"
print(snack)

All lessons in this course

  1. What Is a Variable?
  2. Naming Your Variables
  3. Changing a Value
  4. Using Variables Together
← Back to Coding for Kids