Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
228 views

Python Turtle Lesson 2 - Workbook

This document contains instructions and tasks for using the Python turtle module to draw shapes with different colors, pensizes, and fill patterns. It introduces turtle commands like forward, backward, right, left, penup, pendown, fillcolor, pencolor, begin_fill, end_fill, and circle. Students are asked to write Python programs using these commands to draw simple shapes, multiple shapes, shapes with different numbers of sides, shapes with increasing pen sizes, shapes in different colors, and a tree with a trunk and leaves. The output of their programs should be pasted below each task.

Uploaded by

b
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
228 views

Python Turtle Lesson 2 - Workbook

This document contains instructions and tasks for using the Python turtle module to draw shapes with different colors, pensizes, and fill patterns. It introduces turtle commands like forward, backward, right, left, penup, pendown, fillcolor, pencolor, begin_fill, end_fill, and circle. Students are asked to write Python programs using these commands to draw simple shapes, multiple shapes, shapes with different numbers of sides, shapes with increasing pen sizes, shapes in different colors, and a tree with a trunk and leaves. The output of their programs should be pasted below each task.

Uploaded by

b
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

OCR GCSE

Lesson 2 | Python Turtle Workbook (J277)

Pens and Colors

Mr Haddleton 2020
Python Turtle Lessons OCR GCSE (J277)

Reminder : The Turtle Instructions


import turtle Tell Python to allow use of turtle commands

wn = turtle.Screen() Create a virtual canvas to draw on (Screen)

bob = turtle.Turtle() Create a new turtle called bob

bob.forward(150) Go forward (150 units)

bob.backward(150) Go backward (150 units)

bob.right(90) Turn right (90 degrees)

bob.left(90) Turn left (90 degrees)

bob.penup() Lifts the pen up so you can move the turtle without drawing

bob.pendown() Drops the pen back onto the screen so you can draw

bob.pensize(5) Sets the turtle drawing width to 5 units (1 = thinnest)

bob.fillcolor(“Brown”) Changes the fill colour to brown(or other colour)

bob.pencolor(“Red”) Changes the pen colour to red (or other colour)

bob.begin_fill() Begins to fill the shape

bob.end_fill() End the filling sequence

bob.circle(100) Draw a circle of radius 100 units


Mr Haddleton 2020
Python Turtle Lessons OCR GCSE (J277)

Task 1 - Type in the code below into a new Python file


Use the snipping tool to paste a picture of your program output below

Paste picture here

Mr Haddleton 2020
Python Turtle Lessons OCR GCSE (J277)

Task 2 – Another coloured square


Paste your program here Use the snipping tool to paste a picture of your program output below

Paste program here Paste picture here

Mr Haddleton 2020
Python Turtle Lessons OCR GCSE (J277)

Task 3 – Draw a colored rectangle


Paste your program here Use the snipping tool to paste a picture of your program output below

Paste program here Paste picture here

Mr Haddleton 2020
Python Turtle Lessons OCR GCSE (J277)

Task 4 – Draw two separate coloured rectangles


Paste your program here Use the snipping tool to paste a picture of your program output below

Paste program here Paste picture here

Mr Haddleton 2020
Python Turtle Lessons OCR GCSE (J277)

Task 5 – Draw 4 different shapes


Shape Number sides External angle
Pentagon 5 72
Hexagon 6 60
Octagon 8 45
Decagon 10 36

Use the snipping tool to paste pictures of your program outputs below

Paste pictures here

Mr Haddleton 2020
Python Turtle Lessons OCR GCSE (J277)

Task 6 – Pen Sizes


Use the snipping tool to paste pictures of your program outputs
1. 2. 3. below

4. 5.

Paste pictures here


6.

Mr Haddleton 2020
Python Turtle Lessons OCR GCSE (J277)

Task 7 – Pen Colors (note the American spelling of color not colour)

Use the snipping tool to paste a picture of your program output below

Paste picture here

Mr Haddleton 2020
Python Turtle Lessons OCR GCSE (J277)

Task 8 – Draw a tree in Python (draw trunk first, then leaves)


Use the snipping tool to paste a picture
Paste your program here
of your program output below

Paste program here Paste picture here

Mr Haddleton 2020

You might also like