1import turtle # imports it
2whateverYouWantToCallIt = turtle.Turtle() # adds it to the project
3#code
4whateverYouWantToCallIt.forward(10) # moves whateverYouWantToCallIt forward
5whateverYouWantToCallIt.color("purple") # color
6whateverYouWantToCallIt.left(90) # turns him 90 degrees
7whateverYouWantToCallIt.right(90) # turns him 90 degrees the other direction
1>>> turtle.position()
2(0.00,40.00)
3>>> turtle.sety(-10)
4>>> turtle.position()
5(0.00,-10.00)
6
1import turtle
2
3frank = turtle.Turtle()
4
5frank.shape("turtle")
6
7# then to create a variable you write (you can call your var anything):
8
9def variable_name():
10for i in range(4)
11 frank.forward(20)
12 frank.right(90)
13
14 #then to run this you just right
15
16
17variable_name()
18
19
20