5.10 Exercises
From Foundations of Python ProgrammingGNU FDL 1.3Original pagePython1 class period6 exercisesNot autograded
5.10 Exercises
Read first in the book: 5.1 Hello Little Turtles!, 5.2 Our First Turtle Program, 5.3 Instances: A Herd of Turtles, 5.4 Object Oriented Concepts, 5.5 Repetition with a For Loop, 5.6 A Few More turtle Methods and Observations, 5.7 Summary of Turtle Methods, 5.8 Incremental Programming, 5.9 Common turtle Errors.
Exercise 1
Write a program that prints We like Python's turtles! 100 times.
Open the
01folder and editmain.py. This one is not graded, so check it yourself.
Discussion question: Turtle objects have methods and attributes. For example, a turtle has a position and when you move the turtle forward, the position changes. Think about the other methods shown in the Summary of Turtle Methods page. Which attibutes, if any, does each method relate to? Does the method change the attribute?
Exercise 2
Use for loops to make a turtle draw these regular polygons
(regular means all sides the same lengths, all angles the same):
- An equilateral triangle
- A square
- A hexagon (six sides)
- An octagon (eight sides)
Open the
02folder and editmain.py. This one is not graded, so check it yourself.
Exercise 3
Write a program to draw a shape like this:

Open the
03folder and editmain.py. This one is not graded, so check it yourself.
Exercise 4
Write a program to draw a face of a clock that looks something like this:

Open the
04folder and editmain.py. This one is not graded, so check it yourself.
Exercise 5
Write a program to draw some kind of picture. Be creative and experiment with the turtle methods.
Open the
05folder and editmain.py. This one is not graded, so check it yourself.
Exercise 6
Create a turtle and assign it to a variable. When you print its type, what do you get?
Open the
06folder and editmain.py. This one is not graded, so check it yourself.
For teachers
5.10 Exercises
Students read Foundations of Python Programming's “Exercises” in CS Room and work through its 6 Python coding exercises.
- Time: 1 class period
Reading first
- 5.1 Hello Little Turtles!
- 5.2 Our First Turtle Program
- 5.3 Instances: A Herd of Turtles
- 5.4 Object Oriented Concepts
- 5.5 Repetition with a For Loop
- 5.6 A Few More turtle Methods and Observations
- 5.7 Summary of Turtle Methods
- 5.8 Incremental Programming
- 5.9 Common turtle Errors
Exercises
| Folder | Grading | Tests |
|---|---|---|
01 | Not graded; students check it themselves | 0 |
02 | Not graded; students check it themselves | 0 |
03 | Not graded; students check it themselves | 0 |
04 | Not graded; students check it themselves | 0 |
05 | Not graded; students check it themselves | 0 |
06 | Not graded; students check it themselves | 0 |