The dragon explains
The dragon remembers
The dragon: I can say anything you tell me. But I can also REMEMBER things — and that changes everything.
The dragon: This makes a box called dragon_name and puts Ember inside it. The = means 'put this in there'.
example.pyPython 3dragon_name = "Ember"The dragon: Nothing gets said yet. The box is just sitting there, holding the name, waiting.
example.pyPython 3dragon_name = "Ember"The dragon: Now watch. Put the BOX NAME inside print — no quotes — and I say what is inside it.
example.pyPython 3dragon_name = "Ember"print(dragon_name)
OutputEmberThe dragon: Careful though. With quotes, you get the box's name instead of what is in it.
example.pyPython 3dragon_name = "Ember"print("dragon_name")
Outputdragon_nameThe dragon: Quotes mean 'say these exact letters'. No quotes means 'look inside the box'. Same rule you already know.
example.pyPython 3print(dragon_name)print("dragon_name")
OutputEmber dragon_nameThe dragon: And boxes hold numbers too — those never need quotes at all.
example.pyPython 3gold_coins = 250print(gold_coins)
Output250
Quick check
Check your understanding
Say your answer out loud before reading the marked one. Every wrong option is a mistake real beginners make.
Question 1 of 2
What will I say here?
question.pyPython 3pet_name = "Fluffy"print(pet_name)
- FluffyCorrect
- 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.
Question 2 of 2
And this one — spot the difference.
question.pyPython 3pet_name = "Fluffy"print("pet_name")
- pet_nameCorrect
- 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.
In the game
What you'll practice
Four levels in the game: one guided first try with the shape of the answer already there, then three to solve on your own.
- 1
GuidedYour first try
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.
- +3
PracticeThree more, on your own
Try it yourself — in real Python.
This lesson is part of a free topic: every lesson in it is free, and no card is needed.
Start this lesson for realStuck three times? The game offers the answer — unasked.