Hi! I am relatively new to python and turtle and I really need your help.

Here what I wanted turtle to do: I created a function named carré which
would draw a square with 3 different parameters (color, size, angle).
                                              I did the same for a function
named triangle that would draw an equilateral triangle with the same
parameters
                                              With the help of these 2
functions I wanted turtle to draw a yellow square then lift my pointer let a
space and then draw a blue triangle five times in a row.

Here's my code: ignore my comments

def carre(taille, couleur, angle):
    "fonction qui dessine un carré de taille et de couleur déterminées"
    color(couleur)
    c=0
    while c<4:
        left(angle)
        forward(taille)
        right(90)
        c = c+1

def triangle(taille, couleur, angle):
    "fonction qui dessine un triangle équilatéral de taille, de couleur et
d'angle déterminés"
    color(couleur)
    c=0
    while c<3:
        left(angle)
        forward(taille)
        right(120)
        c = c+1

from dessins_tortue import *

n=0
while n < 10 :
    down()                         # abaisser le crayon
    carre(25, 'yellow', 0)         # tracer un carré
    up()
    forward(30)
    triangle(90, 'blue',0)
n = n + 1


If I am to vague I wanted to do successfully exercise 7.6 in Gérard Swinnen
tutorial for Python

It was supposed to look like this

-- 
Marc-O. Rompré
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to