Lesson 38 of 79 · 15 minutes
Your first function: def and calling: Dance Floor
Teach a dancer a named routine. Then just call its name whenever you want it.
This game is part of the full course.You own the full course.
Unlock all 79 Python coding games for $9, once.Opening the game…
Unlock for $9Play now
What you'll learn
- Giving a name to some code
- Defining doesn't run it
- Call it as often as you like
- Replacing repeated code
- Two ways to forget the brackets
Each idea opens with a short narrated video, about 2 minutes in all. Then you put it to work in the game.
The six levels
- Call the Routine Change it
- A New Routine Copy and type
- Three Times Fill the gap
- Stop Repeating Write it
- Lost Brackets Fix it
- The Long Show Boss level
The levels go from changing one word, to writing the code on your own. The boss level changes every time you play.
New to Python? Start with the free games in Module 1.