Sunday, April 24, 2022

Draw Turkey flag with python turtle

 Code:



from turtle import*

setup(800,500)

speed(5)

penup()

goto(-400, 250)

pendown()

 

color("red")

begin_fill()

for n in range(2):

    forward(800)

    right(90)

    forward(500)

    right(90)

end_fill()

 

penup()

goto(-50, 0)

 

penup()

backward(75)

left(90)

forward(125)

left(90)

pendown()

 

color("white")

begin_fill()

circle(127.5)

end_fill()

 

penup()

goto(-87, 105.5)

pendown()

 

color("red")

begin_fill()

circle(107)

end_fill()

 

penup()

color("white")

goto(50, -35)

right(20)

begin_fill()

for x in range(5):

    forward(100)

    right(144)

end_fill()

 

penup()

goto(350, -255)

right(154)

color("white")


No comments:

Post a Comment