https://github.com/victenna/vicrab/blob/master/aq1.gif

 

 

Example #1

CODE:

import turtle
t=turtle.Turtle()
t=turtle.Turtle(‘circle’)
t1=turtle.Turtle(‘circle’)
t2=turtle.Turtle(‘circle’)
t3=turtle.Turtle(‘circle’)
turtle.tracer(2)
t.shapesize(20)
t.color(‘red’)
t1.penup()
t2.penup()
t3.penup()

t1.goto(-100,15)
t1.shapesize(3)
t1.down()
t1.color(‘blue’)

t2.goto(100,15)
t2.shapesize(3)
t2.down()
t2.color(‘blue’)

t3.color(‘green’)
t3.goto(0,-85)
t3.shapesize(2,8)
t3.down()

 

RESULT:

 

Example #2

CODE:

import turtle
wn=turtle.Screen()
wn.bgcolor(‘gold’)
t1=turtle.Turtle(‘turtle’)
t2=turtle.Turtle(‘turtle’)
t1.color(‘red’)
t1.pensize(5)
t2.color(‘blue’)
t2.pensize(5)
turtle.tracer(2)

#first turtle makes small move
def move_t1():
t1.left(1)
t1.fd(1)

#repeat after 100 ms
turtle.ontimer(move_t1,10)

#second turtle makes small move
def move_t2():
t2.left(-1)
t2.fd(1)
turtle.ontimer(move_t2,10)

move_t1()
move_t2()

turtle.done()

 

 

RESULT:

 

Example #3

CODE:

import turtle
wn=turtle.Screen()
import time
a1=turtle.Turtle()
a1.hideturtle()
a1.pendown()
a1.goto(0,0)
#turtle.tracer(3,5)
turtle.delay(0)

for j in range (13):
a1.penup()
a1.goto(0,20*j)
a1.goto(320,20*j)
a1.penup()
a1.goto(0,20*j)
a1.pendown()
a1.goto(320,20*j)

for i in range (17):
a1.penup()
a1.goto(20*i,0)
a1.goto(20*i,240)
a1.penup()
a1.goto(20*i,0)
a1.pendown()
a1.goto(20*i,240)

b1=turtle.Turtle(‘square’)
b1.penup()
b1.color(‘black’)
b1.pensize(5)
b1.begin_fill()
b1.goto(140,0)
b1.down()
b1.left(90)
b1.fd(40)
b1.rt(90)
b1.fd(20)
b1.left(90)
b1.fd(80)
b1.rt(90)
b1.fd(140)
b1.rt(90)
b1.fd(120)
b1.rt(90)
b1.fd(60)
b1.rt(90)
b1.fd(40)
b1.rt(90)
b1.fd(20)
b1.lt(90)
b1.fd(40)
b1.lt(90)
b1.fd(60)
b1.lt(90)
b1.fd(80)
b1.rt(90)
b1.fd(60)
b1.end_fill()
b1.hideturtle()

b2=turtle.Turtle(‘square’)
b2.penup()
b2.color(‘black’)
b2.pensize(5)
b2.begin_fill()
b2.goto(280,120)
b2.down()
b2.lt(90)
b2.fd(80)
b2.lt(90)
b2.fd(20)
b2.rt(90)
b2.fd(20)
b2.lt(90)
b2.fd(40)
b2.rt(90)
b2.fd(20)
b2.rt(90)
b2.fd(60)
b2.rt(90)
b2.fd(20)
b2.lt(90)
b2.fd(20)
b2.rt(90)
b2.fd(20)
b2.lt(90)
b2.fd(20)
b2.rt(90)
b2.fd(80)
b2.rt(90)
b2.fd(40)
b2.end_fill()
b2.hideturtle()

b3=turtle.Turtle(‘square’)
b3.penup()
b3.color(‘black’)
b3.pensize(5)
b3.begin_fill()
b3.goto(160,100)
b3.down()
b3.lt(90)
b3.fd(100)
b3.lt(90)
b3.fd(20)
b3.lt(90)
b3.fd(20)
b3.rt(90)
b3.fd(20)
b3.lt(90)
b3.fd(20)
b3.rt(90)
b3.fd(80)
b3.rt(90)
b3.fd(20)
b3.lt(90)
b3.fd(20)
b3.rt(90)
b3.fd(20)
b3.lt(90)
b3.fd(20)
b3.lt(90)
b3.fd(100)
b3.lt(90)
b3.fd(20)
b3.rt(90)
b3.fd(20)
b3.lt(90)
b3.fd(40)
b3.rt(90)
b3.fd(20)
b3.lt(90)
b3.fd(40)
b3.lt(90)
b3.fd(20)
b3.rt(90)
b3.fd(40)
b3.lt(90)
b3.fd(20)
b3.rt(90)
b3.fd(20)
b3.end_fill()
b3.hideturtle()

b4=turtle.Turtle(‘square’)
b4.penup()
b4.goto(110,140)
b4.pensize(5)

b5=turtle.Turtle(‘square’)
b5.penup()
b5.color(‘white’)
b5.pensize(5)
b5.goto(50,140)

while True:

for i in range (2):
if i%2==0:
b4.color(‘green’)
b5.color(‘white’)
time.sleep(1)
else:
b4.color(‘white’)
b5.color(‘green’)
time.sleep(1)

RESULT:

 

 

Example #4

CODE:

import turtle
import time
t=turtle.Turtle()
wn=turtle.Screen()
wn.bgcolor(‘dark blue’)
turtle.tracer(3)
t.color(‘coral’)
t1=turtle.Turtle()
t2=turtle.Turtle()
t3=turtle.Turtle()
t1.color(‘gray’)
t2.color(‘gray’)

t3.hideturtle()

t.penup()
t1.penup()
t2.penup()

t.shape(‘square’)
t1.shape(‘circle’)
t2.shape(‘circle’)

t.turtlesize(4,12)
t1.turtlesize(2)
t2.turtlesize(2)

t3.up()
t3.goto(-460,-95)
t3.down()
t3.color(‘green’)
t3.begin_fill()
for j in range (2):
t3.fd(900)
t3.left(90)
t3.fd(15)
t3.left(90)
t3.end_fill()
i=-1
while True:
i=i+1
t.goto(-400+5*i,0)
t1.goto(-460+5*i,-60)
t2.goto(-340+5*i,-60)
time.sleep(0.02)
if t.xcor()>350:
i=-1

 

 

RESULT:

__________________________________________________________________________________________________________________________

 

_________________________________________________________________________________________________________________________________

____________________________________________________________________________________________________________________