The dragon explains
Nothing happens that you didn't write
The dragon: Here's what surprises people most: I never fill in a gap for you.
The dragon: If a step is missing, NOTHING happens for it. No line says 'down', so I never go down — I just bonk into the rock.
example.pyPython 3move_right()move_right()
The dragon: Repeating works the same way. One line runs once — one move_right() is one step, even with the gold far away.
example.pyPython 3move_right()The dragon: And walking over something never picks it up. Watch: I walk right over the gem and keep nothing.
example.pyPython 3move_right()move_right()
The dragon: Only grab() picks things up — and only what I'm standing on.
example.pyPython 3move_right()grab()
The dragon: This will matter a lot once loops arrive. For now, remember: only what's written, happens.
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
I walk onto the gem and then off it again. How many gems am I carrying?
question.pyPython 3move_right()move_right()
- None — no line grabbed itCorrect
- One — I walked right over it
Why: None. There's no grab() in the code, so nothing gets picked up — however close I walk.
Question 2 of 2
move_right() is written ONCE. How many tiles do I move?
question.pyPython 3move_right()- OneCorrect
- As many as it takes to reach the gold
Why: One. A single line runs once — one step, no more, no less.
In the game
What you'll practice
Three levels in the game: one guided first try with the shape of the answer already there, then two to solve on your own.
- 1
GuidedYour first try
The dragon doesn't fill in gaps. This code is missing one step — there's a rock in the way, and nothing tells the dragon to go around it. Run it to see where it gets stuck, then add the missing line.
- +2
PracticeTwo 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.