Offline activities · Quest 8

The loop dance

Invent a short dance and use a loop to repeat it, then a while loop to stop it.

10 minutes

You will need

  • Space to move
  • Music, if you like
  • Paper to write the program

What to do

  1. Choose three moves, such as clap, spin, jump.
  2. Write them as a block: clap, spin, jump.
  3. Write “for i in range(3):” above the block and dance it three times.
  4. Now write “while music is playing:” and dance until the music stops.
  5. Add a counter: after each round, say the number of rounds out loud.

Talk about it

  • When is for better and when is while?
  • What would an endless loop look like in a dance?

See the book Code Quest with Python →