CurriculumPython Variables for KidsThe dragon remembers

What a Python Variable Is, for Kids

Boxes that hold things — and how to look inside them.

Lesson 1 of 5FreeAges 10+
Try this lesson interactively →

The dragon remembers

I can say anything you tell me. But I can also REMEMBER things — and that changes everything.

This makes a box called dragon_name and puts Ember inside it. The = means 'put this in there'.

dragon_name = "Ember"

Nothing gets said yet. The box is just sitting there, holding the name, waiting.

dragon_name = "Ember"

Now watch. Put the BOX NAME inside print — no quotes — and I say what is inside it.

dragon_name = "Ember"
print(dragon_name)

Output

Ember

Careful though. With quotes, you get the box's name instead of what is in it.

dragon_name = "Ember"
print("dragon_name")

Output

dragon_name

Quotes mean 'say these exact letters'. No quotes means 'look inside the box'. Same rule you already know.

print(dragon_name)
print("dragon_name")

Output

Ember
dragon_name

And boxes hold numbers too — those never need quotes at all.

gold_coins = 250
print(gold_coins)

Output

250

Check your understanding

What will I say here?

pet_name = "Fluffy"
print(pet_name)
  • Fluffy
  • pet_name
  • pet_name = "Fluffy"

Why: print(pet_name) with no quotes means 'look in the box and say what's inside', so I say Fluffy. The box's name is just a label; it's never what I say.

And this one — spot the difference.

pet_name = "Fluffy"
print("pet_name")
  • pet_name
  • Fluffy
  • Nothing — that's an error

Why: With quotes, I read the letters exactly: pet_name. It's the same quotes rule from before — quotes mean the literal thing, no quotes means look it up.

What you'll practice

The dragon has never had a name. Make a box called dragon_name, put a name inside it, then ask the dragon to say what it remembers.

Start this lesson for real →

More from this topic

The dragon remembers is one lesson inside Python Variables for Kids — see the full lesson order and what the whole topic covers.

View the full topic →