turtle graphics
DESCRIPTION
TRANSCRIPT
TURTLE GRAPHICSWITH PYTHON
Using a Turtle
Imagine a Turtle … Crawling over a huge
sheet of paper With a pen tied to its
tail.
You can command it.
The basicsTells Python to use the
Turtle module
Sets up a Turtle and makes it a Turtle Shape
Moves forward 100 pixels
Turns right by 90 degrees
Closes the graphic window when you quit
Challenges
Draw a square:By repeating the same commands four
times Using ‘For I in range(4):’
Draw a hexagon Allow the user to say how many sides
the polygon should haveRemember, use ‘myVariable = int(raw_input)’ to get a number from the user
Get the turtle to draw your initials