Search Header Logo
Python 101 Using the Turtle Tool

Python 101 Using the Turtle Tool

Assessment

Presentation

Computers

9th Grade

Practice Problem

Easy

Created by

Maria Cruz Farooqi

Used 8+ times

FREE Resource

10 Slides • 7 Questions

1

Lesson 7 : Using the Turtle Tool / Python 101

Introduction

Congratulations! You've made it to the first lesson of Part II in the Python 101 programming course. In Part II, you will transition from puzzle-based learning to creating open-ended creative projects using the turtle tool. You'll start with the absolute basics, like changing the background color and moving the turtle. However, very quickly, you'll create more complex and interesting projects. Let's get started!

media

2

Learning Target

I can...

  • Use pen drawing to make the turtle draw

  • Create custom shapes using the turtle object

  • Graph using the turtle tool

  • Apply concepts from this lesson to set up a turtle screen, change the screen's background color, and move the turtle object

  • Apply knowledge of the coordinate system to turtle graphics

3

media

4

​The Turtle API
In this lesson you will learn how to use a software library stored in what is called a Python module. In this case, the module is called turtle, and it contains a large set of functions for moving a virtual turtle around a screen.




By learning the turtle application programming interface, or API, you can easily create complex programs. We will teach you several useful turtle functions in this lesson, but if you want to learn more, you can check out the official Python turtle API here.

media

5

Dropdown

Question image
An Application Programming Interface tells you how the functions in a library behave and can be used. ​
can be very long and ​
all at once, but you should​
the turtle API now. In it, you will see documentation for the turtle module that will help you to understand the behaviors of turtle and how to use its ​
.

6

media

7

Dropdown

turtle produces output on a graphics ​
, rather than as text to the console. There are many different ways to produce output, such as ​
, audio, visual, or text.

8

Drag and Drop

Question image

Setting up the Screen

Let's start to display graphics on the screen and draw objects. This is an exciting first step towards making real, ​
!

In order to use turtle graphics, you must import the turtle module. A ​
is a bunch of code that someone else wrote and packaged for us to use. We can import all kinds of other cool functions with import statements, but for now, all we need is ​
.
Drag these tiles and drop them in the correct blank above
playable games
module
turtle

9

Dropdown

Question image

The turtle Screen

We want to ​
on which to draw, something like a blank sheet of paper. The turtle's screen is the ​
where you'll be able to draw using turtles. You can draw on it, display images, and change its color. But in order to use the screen, you must first define it using the ​
function.

10

Dropdown

Question image

Change the Background Color

Now that we've imported the turtle module and defined a screen, we can start making changes to that screen.

Let's try ​
. Notice how it's a method of the screen. By passing different strings to this method, you can​

11

media

​Do this...

12

media

Creating Turtles

The name turtle comes from a virtual "turtle" that crawls around the screen.

We'll use the turtle like a digital pen, drawing wherever it goes.

13

Dropdown

Question image

Creating A Turtle Object

You can create a new turtle using the ​
. In the code below, we ​
, then define its shape to be a "square".

When you run this code, you'll see a square appear in the middle of the screen.

Now the turtle is ready to receive ​

14

media

​Do this...

15

media

16

media

17

Match

Match the following

Turtle Graphics:

Turtle Screen:

Turtle Object:

Coordinate System:

uses a "turtle"

window where you will draw

object that will do all of the drawing

turtle screen coordinate system

Lesson 7 : Using the Turtle Tool / Python 101

Introduction

Congratulations! You've made it to the first lesson of Part II in the Python 101 programming course. In Part II, you will transition from puzzle-based learning to creating open-ended creative projects using the turtle tool. You'll start with the absolute basics, like changing the background color and moving the turtle. However, very quickly, you'll create more complex and interesting projects. Let's get started!

media

Show answer

Auto Play

Slide 1 / 17

SLIDE