Solutions 2.1: Introducing Turtle

Here are the solutions to the exercises from Lesson 2.1: Introducing Turtle.

Exercise 1

Use Turtle and Python Shell to draw two squares of size 100. Draw them in such a way that they are next to each other 100 steps apart. Make sure that the drawing does not contain any other lines.

Solution

There are several ways how to do this. Since the squares are not touching, you must draw one square, lift the pen, move to a new location, put the pen down, and then draw the other square.

Exercise 2

Use Turtle and Python shell to draw a triangle that has one side of length 100, the other side of length 120, and the angle between these 2 sides is  75 degrees.

[cws-ad1]

Solution

In order to have an inner angle of 75°, the outer angle must be 180° – 75° = 105°.

And since we don’t know the length or angle of the third side, we must use the home() instruction to return to the starting point.

Exercise 3

Draw a five-point star.

Solution

The hint to this exercise told us that the inner angle at each point is 180° / 5 = 36°. And since inner angle is 36°, the outer angle must be 180° – 36° = 144°.

[prev-next-ad1 prev=”https://codewithsara.com/python-with-sara/python-101/u2-python-turtle-graphics/u2-answers/” next=”https://codewithsara.com/python-with-sara/python-101/u2-python-turtle-graphics/u2s2-turtle-programming/”]