Created
July 24, 2023 18:11
-
-
Save DevloperHS/a5591bcf345b58a6400a0ea5f1767b7f to your computer and use it in GitHub Desktop.
National Flag Pattern
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import turtle | |
| colors = ["green", "white", "red"] | |
| t = turtle.Pen() | |
| turtle.bgcolor("black") # Set the background color to black | |
| for i in range(200): | |
| t.speed('fastest') | |
| t.pencolor(colors[i % 3]) | |
| t.width(i / 100 + 1) | |
| t.forward(i) | |
| t.left(59) | |
| t.penup() | |
| t.goto(0, 0) | |
| t.pencolor("white") | |
| t.write("JAI HIND", align="center", font=("Arial", 24, "bold")) | |
| turtle.exitonclick() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment