Python Turtle Instructions
Starter
Start by sharing the following code:
Start by sharing the following code:
Ask students to make a prediction about the output from the code.
Run the code and aks the students if their predictions were correct.
Go through each line of code (line-by-line) and explain what each line does.
Challenge
1. Share with the students the following basic commands:
2. Have students explore the following commands from the Turtle library before creating their own Turtle artwork!
Run the code and aks the students if their predictions were correct.
Go through each line of code (line-by-line) and explain what each line does.
- import turtle (Imports the turtle library)
- window = turtle.Screen() (Creates a new blank canvas to draw on)
- timmy = turtle.Turtle() (Creates a new turtle called timmy)
- timmy.forward(100) (Move the turtle forwad 100 steps)
- timmy.right(90) (Rotates the turtle right by 90 degrees)
- timmy.forward(100) (Move the turtle forwad 100 steps)
- timmy.right(90) (Rotates the turtle right by 90 degrees)
- timmy.forward(100) (Move the turtle forwad 100 steps)
- timmy.right(90) (Rotates the turtle right by 90 degrees)
- timmy.forward(100) (Move the turtle forwad 100 steps)
- timmy.right(90) (Rotates the turtle right by 90 degrees)
Challenge
1. Share with the students the following basic commands:
- forward (Move the turtle forward)
- backward (Move the turtle backwards)
- right (Right turn)
- left (Left turn)
- up (Pen up)
- pendown (Pen down)
- pensize (Change the size of the pen)
- pencolor (Change the pen colour)
2. Have students explore the following commands from the Turtle library before creating their own Turtle artwork!
turtle up()
The turtle up() command stops all drawing. It pull the pen up and nothing will be drawn to the screen, until down is called.
Syntax:
turtle.up()
turtle down()
The turtle down() command is used to pull back the pen down on the screen and it starts drawing when moving.
Syntax:
turtle.down()
Example:
The turtle up() command stops all drawing. It pull the pen up and nothing will be drawn to the screen, until down is called.
Syntax:
turtle.up()
turtle down()
The turtle down() command is used to pull back the pen down on the screen and it starts drawing when moving.
Syntax:
turtle.down()
Example:
turtle backward()
The turtle backward() command is used to move the turtle backward by a specified distance, which is opposite to the direction of the turtle head.
Syntax:
turtle.backward(distance)
turtle forward()
The turtle forward() command is used to move the turtle forward by the specified distance, in the direction the turtle headed.
Syntax:
turtle.forward(distance)
turtle color()
The turtle color() command is used to change the color of the turtle, and the default color of the turtle is “black”.
Syntax:
turtle.color(*args)
Example:
The turtle backward() command is used to move the turtle backward by a specified distance, which is opposite to the direction of the turtle head.
Syntax:
turtle.backward(distance)
turtle forward()
The turtle forward() command is used to move the turtle forward by the specified distance, in the direction the turtle headed.
Syntax:
turtle.forward(distance)
turtle color()
The turtle color() command is used to change the color of the turtle, and the default color of the turtle is “black”.
Syntax:
turtle.color(*args)
Example:
turtle goto()
The python turtle goto() command is used to move the turtle from the current position to the x,y location along the shortest linear path between the two locations.
Syntax:
turtle.goto(x,y)
turtle left()
The turtle left() command is used to change the direction of the turtle by the given value of the argument. So, it turns the turtle counter clockwise.
Syntax:
turtle.left(angle)
turtle right()
The turtle right() command is used to change the direction of the turtle by the given value of the argument. So, it turns the turtle counter clockwise.
Syntax:
turtle.right(angle)
Example:
The python turtle goto() command is used to move the turtle from the current position to the x,y location along the shortest linear path between the two locations.
Syntax:
turtle.goto(x,y)
turtle left()
The turtle left() command is used to change the direction of the turtle by the given value of the argument. So, it turns the turtle counter clockwise.
Syntax:
turtle.left(angle)
turtle right()
The turtle right() command is used to change the direction of the turtle by the given value of the argument. So, it turns the turtle counter clockwise.
Syntax:
turtle.right(angle)
Example:
Challenge: Create your own turtle artwork using the turtle library in Python!
You may also be interested in:
Tags: programming language python, python programming language, python coding language, programming languages python, python code language, python programming language example, what is the python programming language, python scripting, language tutorial, what type of programming language is Python, python class, python how to learn, learn python, learn python from scratch, where to learn Python, coding on computer, computer coding, best place to learn coding online, online coding, online code, computer programming and Coding, hour of code program, computer science degree programs, programs for computer science, what does coding mean in computers, how does computer code work, what is computer programmer.