1import turtle
2satya = turtle.Turtle()
3maan = turtle.Turtle()
4#for my satya object
5satya.shape("turtle")
6satya.color('blue')
7distance = 100
8satya.forward(distance)
9#for my maan object
10maan.goto(10,200)
11
12
13screen = turtle.Screen()
14screen.exitonclick()
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
1import turtle
2#creating a square with turtle
3t = turtle.Turtle()
4t.forward(100)
5t.color('blue')
6t.right(90)
7t.forward(100)
8t.right(90)
9t.forward(100)
10t.right(90)
11t.forward(100)
12
1 >>> tp = turtle.pos()
2 >>> tp
3 (0.00,0.00)
4 >>> turtle.setpos(60,30)
5 >>> turtle.pos()
6 (60.00,30.00)
7 >>> turtle.setpos((20,80))
8 >>> turtle.pos()
9 (20.00,80.00)
10 >>> turtle.setpos(tp)
11 >>> turtle.pos()
12 (0.00,0.00)
13
1>>> player_one = turtle.Turtle()
2>>> player_one.color("green")
3>>> player_one.shape("turtle")
4>>> player_one.penup()
5>>> player_one.goto(-200,100)
6>>> player_two = player_one.clone()
7>>> player_two.color("blue")
8>>> player_two.penup()
9>>> player_two.goto(-200,-100)
10