You are on page 1of 1

import turtle # module des graphiques tortue

m = turtle.Turtle() # créer une nouvelle tortue

m.speed("fastest") # tracé rapide

def square(i):

for c in ("black","yellow","red"):

m.color(c)

m.pendown()

m.begin_ ll()

m.forward(i/3)

m.right(90)

m.forward(i*2/3)

m.right(90)

m.forward(i/3)

m.right(90)

m.forward(i*2/3)

m.right(90)

m.forward(i/3)

m.end_ ll()

square(300)

def three_color_ ag(h,color1, color2,color3):

for c in (color1,color2,color3):

m.color(c)

m.pendown()

m.begin_ ll()

m.forward(h/3)

m.right(90)

m.forward(h*2/3)

m.right(90)

m.forward(h/3)

m.right(90)

m.forward(h*2/3)

m.right(90)

m.forward(h/3)

m.end_ ll()

three_color_ ag(300,"red","blue","yellow")
fl
fi
fi
fi
fl
fi

You might also like