Diamond
Create a Python program that uses turtle graphics to draw a diamond.
Example
Star
One of the first shapes you learned to draw in grade school was probably a star. It is a pretty easy shape to draw, looks pretty cool, and can be done entirely with straight lines. The only tricky part is determining how to go from one point of the star to the next. Today, you will figure that part out.
Details
Create a Python program that uses the turtle module to draw a five-pointed star.
Example
Hint
- Drawing the star is much easier if you use the functions
turtle.forward
and eitherturtle.left
orturtle.right
. - Note that the turtle will turn 5 times, once for each star point. Also, note that the turtle will turn a total of 720°. So, you can calculate the number of degrees in each turn by dividing 720 by 5.
- Finally, drawing the star is merely alternating between moving forward and turning.
House
One of the significant advantages of using a computer for drawing is that it is possible to draw precisely. It makes creating something perfectly symmetrical straightforward.
Details
Create a Python program that uses the turtle module to draw a simple house. The house should be a square with a triangle for a roof and a rectangle for a door. The house should be symmetrical about a vertical line.
Example
Hint
- The trickiest part of the house is getting the roof to fit perfectly. To get it to fit perfectly, you need to calculate the angle of the roof and the length of the roof edges.
- If you use a 45-45-90 triangle, then the roof angle is 45 degrees, and the roof length is the house width divided by the square root of 2.
Challenge
Spruce up the house. Add things like a chimney, the sun, a tree, a mailbox, a fence, whatever you want.