Activity: For Loop
I'M FINISHED WITH HOUR OF CODE!

STEP 8: We can make the hedgehog move the same distance using only 3 lines of code!

For Loops let you repeat a certain group of commands more than once.

The number in range() determines how many times the loop repeats.

  • The loop below only repeats 2 times. Change the for loop so that it repeats 4 times and completes the maze.``

sprite.pen_down() for counter in range(2): # add code here sprite.move_forward(5) sprite.turn_right(90)
Support