Skip to content

Instantly share code, notes, and snippets.

@DevloperHS
Created July 27, 2023 17:30
Show Gist options
  • Select an option

  • Save DevloperHS/ec9469cdb48657e177d4610c91ebc7fd to your computer and use it in GitHub Desktop.

Select an option

Save DevloperHS/ec9469cdb48657e177d4610c91ebc7fd to your computer and use it in GitHub Desktop.
Python TURTLE challenge | draw national flag pattern
import turtle
colors = ["#FF9933", "white", "green"]
t = turtle.Pen()
turtle.bgcolor("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