Practice with Turtles¶
As we have seen before turtles can draw letters like a capital C as shown below. It draws each line without picking up the pen in between.
Mixed up programs
The following program uses a turtle to draw a capital Z as shown in the picture to the left of this text, <img src=”../_static/DrawZ.png” width=”200” align=”left” hspace=”10” vspace=”5” /> but the lines are mixed up. The program should do all necessary set-up: import the turtle module, get the space to draw on, and create the turtle. Then it should draw the lines for the Z in the order shown by the numbers on the picture. <br /><br /><p>Drag the needed blocks of statements from the left column to the right column and put them in the right order. There may be extra blocks that are not needed in a correct solution. Then click on <i>Check Me</i> to see if you are right. You will be told if any of the lines are in the wrong order or are the wrong blocks.</p>
The following program uses a turtle to draw a capital N as shown in the picture to the left of this text, <img src=”../_static/DrawN4.png” width=”200” align=”left” hspace=”10” vspace=”5” /> but the lines are mixed up. The program should do all necessary set-up: import the turtle module, get the space to draw on, and create the turtle. Remember that the turtle starts off facing east when it is created. Then it should draw the lines for the N in the order shown by the numbers on the picture. <br /><br /><p>Drag the needed blocks of statements from the left column to the right column and put them in the right order. There may be some extra blocks that are not needed in a correct solution. Then click on <i>Check Me</i> to see if you are right. You will be told if any of the lines are in the wrong order or are the wrong blocks.</p>
The following example has 4 errors. Can you fix the errors so that the code runs correctly to print a capital L?
The following example has 4 errors. Can you fix the errors so that the code runs correctly to print a capital C?
Note
Case matters in Python so screen
is not the same as Screen
. Also the open and close parentheses are required after every function and procedure call, even if it doesn’t take any input.
Use the area below to try to draw a letter or number. Use block style rather than curves.