What is Python, What is Python Programming language, Why Python, What is Python used for, Python 3, 10 reason why should you learn Python , Why python is best for beginner in programming, Learn Python for free
Indian Flag Using Python
Happy Republic Day, hope you enjoyed this video and knew something about turtle module. So make sure to hit the like and subscribe button and also share this video to your friends and family so that they can also get some knowledge about this
Video's Link
Source Code
import turtle
flag = turtle.Turtle()
flag.speed(3)
flag.pensize(5)
flag.color('#000080')
def draw(x, y):
flag.penup()
flag.goto(x,y)
flag.pendown()
#Ashoka Chakra
for i in range(24):
flag.forward(80)
flag.backward(80)
flag.left(15)
draw(0, -80)
flag.circle(80, 360)
draw(0,-90)
#Green Rectangle
flag.color('#138808')
flag.begin_fill()
flag.forward(350)
flag.backward(700)
flag.right(90)
flag.forward(200)
flag.left(90)
flag.forward(700)
flag.left(90)
flag.forward(200)
flag.left(90)
flag.end_fill()
#Orange Rectangle
flag.color('#FF9933')
draw(-350,90)
flag.begin_fill()
flag.right(180)
flag.forward(700)
flag.left(90)
flag.forward(200)
flag.left(90)
flag.forward(700)
flag.left(90)
flag.forward(200)
flag.end_fill()
flag.hideturtle()
turtle.done()
Nice
ReplyDelete