easter.py

Created by schraf

Created on April 09, 2023

553 Bytes

Vidéo sur comment dessiner un ovale avec la tortue Python


from turtle import *
from random import *

hideturtle()

coul = (250,120,130),(140,200,40),(65,170,245),(250,160,45)
 
def oeuf(r):
 for (d,a) in (1,180),(2,45),(.586,90),(2,45): circle(int(d*r),a)

for c in range(10):
 for l in range(5):
    color(choice(coul))
    penup()
    goto(-140 + 30 * c,-85 + 42 * l)
    pendown()
    setheading(randint(-30,30)) 
    pensize(3)
    for i in range(1, 10, 2): 
        if random() < .2: color(choice(coul))
        if i == 9: 
            color((60,60,60))
            pensize(2)
        oeuf(i)

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.