Featured Post

Data Science Concepts

Python Turtle - Draw India Flag In Python Turtle Graphics | National Flag By #BKTutorial

 







Source Code:

#India Flag

import turtle
t=turtle
t.title("India Flag")
t.speed(1)
t.setup(800, 500)

# Move to start position
t.penup()
t.goto(-400,260)
t.pendown()

t.color("orange")
t.begin_fill()
t.forward(800)
t.right(90)
t.forward(167)
t.right(90)
t.forward(800)
t.end_fill()

t.color("white")
t.begin_fill()
t.left(90)
t.forward(167)

t.color("green")
t.begin_fill()
t.forward(167)
t.left(90)
t.forward(800)
t.left(90)
t.forward(167)
t.end_fill()

# Big Blue Circle
t.penup()
t.goto(70, 0)
t.pendown()
t.color("navy")
t.begin_fill()
t.circle(70)
t.end_fill()

# Big White Circle
t.penup()
t.goto(60, 0)
t.pendown()
t.color("white")
t.begin_fill()
t.circle(60)
t.end_fill()

# Mini Blue Circles
t.penup()
t.goto(-57, -8)
t.pendown()
t.color("navy")

# Small Blue Circle
t.penup()
t.goto(20, 0)
t.pendown()
t.begin_fill()
t.circle(20)
t.end_fill()

# Spokes
t.penup()
t.goto(0, 0)
t.pendown()
t.pensize(2)
for i in range(24):
    t.forward(60)
    t.backward(60)
    t.left(-15)

t.hideturtle()
t.exitonclick()



Comments