HOW TO MAKE AFGHANISTAN FLAG USING PYTHON TURTLE
Hello Guys, I will tell you how to make the Afghanistan flag using python turtle in this blog.
Follow the given instruction in the video.
- import turtle as t #so you don't have to write trutle many times
- then make a rectangle color Green.
- then make two rectangles one after the other inside the Green rectangle and fill them with red and black colors respectively.
- Now you are almost done with the flag and at last, you have to make the Emblem of Afghanistan.
- It is tough๐ to make an Afghanistan emblem so, take the gif of the Emblem of Afghanistan and display it at last.
#Result
-------------------------The End-------------------------
#SOURCE CODE #flag
import turtle as t
t.penup()
t.forward(510)
t.pendown()
t.left(90)
#Green side
t.fillcolor("green")
t.begin_fill()
t.forward(340)
t.left(90)
t.forward(1023)
t.left(90)
t.forward(683)
t.left(90)
t.forward(1023)
t.left(90)
t.forward(400)
t.end_fill()
t.left(90)
t.penup()
t.forward(340)
t.pendown()
#red side
t.fillcolor("red")
t.begin_fill()
t.right(90)
t.forward(283)
t.left(90)
t.forward(343)
t.left(90)
t.forward(683)
t.left(90)
t.forward(343)
t.left(90)
t.forward(400)
t.end_fill()
t.penup()
t.left(90)
t.forward(343)
t.right(90)
t.pendown()
#black side
t.fillcolor("black")
t.begin_fill()
t.forward(283)
t.left(90)
t.forward(340)
t.left(90)
t.forward(683)
t.left(90)
t.forward(340)
t.left(90)
t.forward(400)
t.end_fill()
t.forward(280)
t.penup()
t.home()
t.pendown()
screen = t.Screen()
screen.addshape("hop.gif") #the image name you have taken
t.shape("hop.gif")
t.done()
See you in the Next blog please comment something, I get motivated by your comments.๐
Comments
Post a Comment
If you have any doubt you can comment