Here, we will be making “The Great Indian Flag” using Python Turtle Graphics.
Turtle graphics
In computer graphics, turtle graphics are vector graphics using a relative cursor upon a Cartesian plane. Turtle is a drawing board-like feature that lets us command the turtle and draw using it.
Approach
import turtle
2. Get a screen to draw on.screen = turtle.Screen()
3.Define an instance for turtle(here “t”).
4. For making an Indian Flag let’s divide the process into 4 steps:
- The rectangle with orange color.
- Then the middle rectangle.
- Then the last Green Rectangle.
- Then Ashoka Chakra inside the middle rectangle.
5. Here dimensions of all three Rectangles are (800 units x 167 units), which makes up dimensions of the flag as (800 units x 501 units).
6. The turtle starts from coordinates (-400, 250).
7. Then from that position it makes the First rectangle of orange color.
8. Then from the ending point of the first rectangle, Turtle makes the Second rectangle of no color.
9. Then the Third green color rectangle is made. Now for Ashoka Chakra, we need to perform a set of operations
- A Big Blue circle and a white circle just smaller than blue.
- Set of small blue circles on the inner lining of a blue and white circle.
- And finally spokes inside the two blue and white circles starting from the Centre towards the outer direction.
10. Finally, The pride of one’s Nation is ready.
Below is the implementation of the above approach:
Output:
Thankyou Guys!