turtle python code code example
Example 1: how to import turtle in python
import turtle
whateverYouWantToCallIt = turtle.Turtle()
whateverYouWantToCallIt.forward(10)
whateverYouWantToCallIt.color("purple")
whateverYouWantToCallIt.left(90)
whateverYouWantToCallIt.right(90)
Example 2: python turtle tutorial
>>> turtle.pos()
(440.00,-0.00)
Example 3: python turtle tutorial
>>> s = turtle.getscreen()
Example 4: turtle module python
>>> player_one = turtle.Turtle()
>>> player_one.color("green")
>>> player_one.shape("turtle")
>>> player_one.penup()
>>> player_one.goto(-200,100)
>>> player_two = player_one.clone()
>>> player_two.color("blue")
>>> player_two.penup()
>>> player_two.goto(-200,-100)
Example 5: python turtle tutorial
>>> turtle.heading()
22.0
>>> turtle.right(45)
>>> turtle.heading()
337.0
Example 6: python turtle tutorial
>>> turtle.position()
(0.00,40.00)
>>> turtle.sety(-10)
>>> turtle.position()
(0.00,-10.00)