In this class, students will learn Turtle graphics in Python, including essential functions, coordinate manipulation, and step-by-step instructions to draw a penguin. As part of this project you will learn:
Turtle is a graphic library for Python. Using Turtle, we can easily draw in a drawing board.
Now, let's explore some essential Turtle functions. We'll start by drawing a circle and filling it with a colour. We will use the following commands:
To draw the rectangle, follow these steps:
Draw the penguin body.
Draw the penguin belly.
Draw the penguin's nose.
# Nose pu() goto(60, 80) pd() color("orange") stamp()
Draw the penguin's eyes.
# Eye 1 pu() goto(30, 110) pd() color("white") shape("circle") stamp() color("black") begin_fill() circle(5) end_fill() # Eye 2 pu() goto(90, 110) pd() color("white") stamp() color("black") begin_fill() circle(5) end_fill()
Draw the penguin's arms.
# Arms pu() goto(0, 50) pd() shape("triangle") color("black") stamp() goto(120, 50) stamp()
Draw the penguin's legs.
# Legs shape("square") color("orange") pu() goto(45, -60) pd() stamp() goto(80, -60) stamp()
Once you run this code, it should create a cute penguin drawing using the Turtle graphics library in Python. Your code should be similar to this:
You have completed this project.