Ticker

6/recent/ticker-posts

Unique Pattern With Turtle In Python - pattern 1

 


In this program we are going to make a very unique pattern in python using turtle library.

Its super easy to code and so much fun. Try out this program and the code is following :


import turtle
a=turtle.Turtle()
screen=turtle.Screen()
screen.bgcolor('black')
col=('white','red','orange','yellow','green','blue','cyan')
a.speed(100)

for i in range (200):
    a.forward (i*4)
    a.right(91)
    a.color(col[i%7])
    for b in range (3):
      a.forward(i*4)
      a.right(91)
      for c in range (2):
        a.forward(i*4)
        a.right(91)
        

Post a Comment

0 Comments