Closed Shapes

Task 1 - Square

Write a program that will draw a square. It must use a fixed loop.

Help

from turtle import *
screen = getscreen()
tom = Turtle()

for counter in range(4):
    tom.forward(100)
    tom.right(90)

Extension

Fill the square with a colour.

Task 2 - Pentagon

Write a program that will draw a pentagon. It must use a fixed loop.

Help

from turtle import *
screen = getscreen()
tom = Turtle()

for counter in range(5):
    tom.forward(100)
    tom.left(??)

Extension

Fill the pentagon with a colour.

Task 3 - Octagon

Write a program that will draw an octagon. It must use a fixed loop.

Help

from turtle import *
screen = getscreen()
tom = Turtle()

for counter in range(??):
    tom.forward(??)
    tom.left(??)

Extension

Fill the octagon with a colour.

Task 4 - Circle

Write a program that will draw a circle. It must use a fixed loop.

Help

You will need lots of turns to make it appear smooth.

from turtle import *
screen = getscreen()
tom = Turtle()

for counter in range(??):
    tom.forward(??)
    tom.left(??)

Extension

Fill the circle with a colour.

Task 5 - Rectangle

Write a program that will draw a rectangle. It must use a fixed loop.

Help

You will need two forward commands inside the loop.

from turtle import *
screen = getscreen()
tom = Turtle()

for counter in range(??):
    tom.forward(??)
    tom.right(90)
    tom.forward(??)
    tom.right(90)

Extension

Fill the rectangle with a colour.

Targets

State the command to repeat instructions

Identify the correct commands needed to solve a problem

Write a Python program to draw a basic shape using a loop