Python Turtle Graphics Tutorial PDF
Python Turtle Graphics Tutorial PDF
Tutorial
GGC S3
Programming Skills Objectives:
Identify and program Python code in JES (Jython Environment for Students) and save into their file
area with proper extension. (ProgramName.py)
Use following commands to draw shapes and designs with Turtles.
Use comments in program to describe what code will do.
Troubleshoot and solve coding errors and problems.
Run code from written programs and from program and command area.
Define and use Python functions.
Use the "for i in range(x)" commands to do repeats.
Opening JES Software
In this tutorial, you will practice using the Turtle Commands used in this Tutorial:
Command Area to test and draw a
Square and a Rectangle. turtle.forward()
spiralSquare(turtle)
STOP! Time to Switch Roles
windmill(turtle)
Tutorial 5: Putting it All Together
Create a Plus Sign
Do It Yourself!
Combine all the Turtle Commands you’ve
learned and create a Plus sign!
Use Paper and Pencil if needed.
Raise your hand if you need assistance!
Make sure you save and “Load Program”
Then call your function in Command
Area.
Try completing the task, before looking at
the Hint.
Tutorial 5: Putting it All Together
Create a Plus Sign
turtle.forward(distance)- command to move the turtle in the directions it’s facing. Default
distance is 100 pixels.
turtle.turn(degrees)- turns the turtle in 90 degrees depending on the direction its facing.
turtle.moveTo(x, y)- command to place the turtle in a new location in the world.
turtle.penUp()- command to pick the pen up.
turtle.penDown()- command to put the pen down again to draw.
turtle.penWidth = (1-10) - allows you to change the size of the pen
turtle.color = red (blue, green . . .) -or- (255, 255, 255) RGB notation- allows you to change the
color of the pen and turtle.
makePlus(turtle) Function Hint Example
CONGRATULATIONS!
Copy and paste the URL below into your browser to take the survey!
Thanks, we appreciate your feedback!
http://tinyurl.com/ggctech