Fun with Flags – Part 1: flags and turtles

Step 4 – My turtle doesn't want to be square

I'm going to use my turtle to draw flags. Most flags aren't square*.

I need to use the turtle to draw a rectangle.

I want a rectangle that is 180 turtle steps wide and 150 turtle steps tall. That's the right sort of shape for almost all flags.

Problem – draw a rectangle

STOP: Do not add this code underneath your square. Either start a new Python window or delete your square and then code the rectangle.

    Code helper image
  1. Add to this code to get a rectangle:
    from turtle import *
    forward(180)
    right(90)
    forward(150)
    ...
  2. Run your code to check that it draws a rectangle

Make sure your flag is 180 steps wide and 150 steps tall.

Now we can draw a rectangle we can start to draw proper flags.

* the flags of Switzerland and the Vatican City are both square. The flag of Nepal is the oddest flag of all – take a look