![Technovation logo](../_images/Technovation-yellow-gradient-background.png)
4.5. Practice Makes Perfect¶
Command |
What does it do? |
---|---|
|
Move forward a specified distance |
|
Move backward a specified distance |
|
Turns 90 degrees to the left (you can use any angle, not just 90!) |
|
Turns 90 degrees to the right |
|
Draws a circle with the specified radius |
|
Move straight to the position with coordinates (x, y). Note: the center is (0, 0) |
|
Stop leaving a trail |
|
Start drawing a trail |
|
Set the color to c (https://trinket.io/docs/colors) |
|
Repeat n times |
Command |
What does it do? |
---|---|
|
Starts filling in drawn shapes |
|
Stops filling in drawn shapes |
|
Determines how quickly the turtle will move through commands |
|
Creates and defines a new function |
|
Calls a function |
![Image of a row of squares drawn with Python Turtle](../_images/square-row2.png)
![Image of a row of triangles drawn with Python Turtle](../_images/triangle-row.png)
![Image of a yellow stars on a blue background drawn with Python Turtle](../_images/stars.png)
move forward 50 pixels
turn left 144 degrees
![Image of a trees made of triangles drawn with Python Turtle](../_images/forest.png)
How might you draw a forest? Draw a bunch of pine trees!
How might you draw a pine tree? Draw a stack of triangles!
How might you draw a stack of triangles? Draw individual triangles offset in a loop!
triangle()
using a for looptree()
by calling triangle()
inside of a loopforest()
by calling tree()
inside of a loopforest()
function, and watch the magic happen!![Image of red an green triangles in a row drawn with Python Turtle](../_images/color-triangle-row.png)