Let’s Recap
In our previous challenge, we looked at using sequencing to write a program using Python Turtle to complete a drawing.
Remember when using Python Turtle, the most useful instrcutions are as follows:
- myPen.color(“red”)
- myPen.forward(100)
- myPen.right(90)
- myPen.left(45)
- myPen.penup()
- myPen.pendown()
- myPen.goto(0,0)
- myPen.circle(50)
Learning Objectives:
In this challenge we are going to use for loops to repeat a set of instructions many times. This is called iteration.
We are also going to look at nested loops. (A loop within a loop)
Challenge:
By using a loop you can repeat a set of instructions many times. This is called iteration.
Look at the following scripts: Can you create your own script using iteration?
Iteration Example 1: (Star)
Iteration Example 2: (Flower)
Iteration Example 3: (Using nested loops)