Important Note

When setting up your .py file, this should be the structure:

from turtle import *

#all of your code goes here

mainloop()

Make sure you include the call to mainloop(). This is a built-in function and helps manage the window.

def setupPen(pColor, fColor, pSize):

t.pen(pencolor=pColor, fillcolor=fColor, pensize=pSize)

Make sure you include the call to mainloop(). This is a built-in function and helps manage the window.

Turtle

 

Python has a graphics library called Turtle.

We can import this library into our .py files and mess around with the available code.

In this unit we are going to explore the Turtle library.

We will complete a series of sprints to help us do this.

Setup

You are going to download files in this unit.

On your computer create a folder called Turtle Sprints

Move your download files into this folder before each sprint starts.

Sprint 1

  • In your IDE, create a new file called sprint1
  • Save it in your project folder
  • and paste in the starter code.

Watch the video, create a Turtle called Fred and make him move across the screen.

 
 

Sprint 2

  • In your IDE, create a new file called sprint2
  • Save it in your project folder
  • and paste in the starter code.

Watch the video, create a list of Turtles and make them move across the screen. Display the winner!

 
 

Sprint 3

  • Open sprint2.py in your IDE.
  • File → Save As → sprint3.py

Let's make a predition on which racer will win!

 
 

Sprint 4

 

Sprint 5

Great! Sprints 1-4 guarantee a project grade 'C'

If you want to achieve Project Grade 'B', complete Sprint 5.

 

Sprint 6

Thinking of achieving Project Grade 'A'? Complete Sprint 6.

Note, you can only achieve Project Grade 'A' if you already achieved Project Grade 'B' after completing Sprint 5.

 

Exemplars

  MMV
  MMV

Work with AI

AI is very helpful and can generate great ideas.

Often it doesn't give us exactly what we are looking for so we have to edit the code AI generates.

Learning to work with AI effectively will help you to develop your coding skills.