About what i learn today in the class

i work little bit on project or code

and today i made one flower


import turtle
t = turtle.Turtle()
screen = turtle.Screen()
t.pensize(4)
petal_size = 200
r  = petal_size / 5 + 35
def set_of_petals(x):
    for i in range(8):
        t.penup()
        t.goto(0, 0)
        t.forward(x)
        t.pendown()
        t.fillcolor("pink")
        t.begin_fill()
        t.circle(petal_size, 60)
        t.left(180 - 2 * 60 + 45) 
        t.circle(petal_size, 60)
        t.left(180)
        t.end_fill()
for i in range(4):
    set_of_petals(r)
    petal_size -= 40
    r = petal_size / 5 + 35
    t.left(22.5)    
t.fillcolor("red")
t.begin_fill()
t.penup() 
t.goto(0, -60)
t.right(90)
t.pendown()
t.circle(60)
t.end_fill()            
t.ht()
screen.exitonclick()

here is the flower picture

i also i watched i video from You Tube

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top