Python exercises for ages 10+

Draw a grid

Demo of turtle drawing a 3x3 grid

Part 1

Using the turtle library, draw a square where each side is 20 pixels long. Use a for loop to avoid code repetition. Each iteration of the for loop should draw one side of the square.

Part 2

Using nested loops, draw 3 squares in a row side by side. Then, draw 3 rows of three squares to make a grid. Pay attention to proper indentation. You can use the function calls speed(0) to speed up the drawing, or delay(0) to go even faster for testing.