Share your repls and programming experiences

← Back to all posts
kuwait flag
Aghaanaa (0)

import turtle
turtle.shape('turtle')

#Pen up and move to starting position
turtle.penup()
turtle.goto(-150,150)
turtle.pendown()

#set pensize and choose fill colour
turtle.pensize(1)
turtle.color("#37a830","#37a830")
turtle.begin_fill()

#draw the Green shape
turtle.forward(300)
turtle.right(90)
turtle.forward(75)
turtle.right(90)
turtle.forward(225)
turtle.right(45)
turtle.forward(105)
turtle.end_fill()

#set pensize and choose fill colour
turtle.pensize(1)
turtle.color("#000000","#000000")
turtle.begin_fill()

#draw the Black shape
turtle.right(180)
turtle.forward(105)
turtle.right(45)
turtle.forward(100)
turtle.right(45)
turtle.forward(105)
turtle.right(135)
turtle.forward(250)
turtle.backward(250)
turtle.end_fill()

#set pensize and choose fill colour
turtle.pensize(1)
turtle.color("#FF0000","#FF0000")
turtle.begin_fill()

#draw the Red shape
turtle.right(90)
turtle.forward(300)
turtle.left(90)
turtle.forward(75)
turtle.left(90)
turtle.forward(225)
turtle.left(45)
turtle.forward(105)
turtle.end_fill()
turtle.backward(105)
turtle.right(45)
turtle.backward(225)
turtle.right(90)

#set pensize and choose fill colour
turtle.pensize(1)
turtle.color("#FFFFFF","#FFFFFF")
turtle.begin_fill()

#draw the White shape
turtle.forward(99)
turtle.left(90)
turtle.forward(225)
turtle.left(90)
turtle.forward(99)
turtle.left(90)
turtle.forward(225)
turtle.end_fill()