Skip to content

Commit

Permalink
Merge pull request #2061 from Abhidongre/master
Browse files Browse the repository at this point in the history
Colour spiral using python
  • Loading branch information
fineanmol authored Oct 3, 2022
2 parents f295eaa + 73a7491 commit 8e5d45d
Showing 1 changed file with 52 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# import turtle

import turtle

# defining colors

colors = ['red', 'yellow', 'green', 'purple', 'blue', 'orange']

# setup turtle pen

t= turtle.Pen()

# changes the speed of the turtle

t.speed(10)

# changes the background color

turtle.bgcolor("black")

# make spiral_web

for x in range(200):

t.pencolor(colors[x%6]) # setting color

t.width(x/100 + 1) # setting width

t.forward(x) # moving forward

t.left(59) # moving left

turtle.done()

t.speed(10)


turtle.bgcolor("black") # changes the background color

# make spiral_web

for x in range(200):

t.pencolor(colors[x%6]) # setting color

t.width(x/100 + 1) # setting width

t.forward(x) # moving forward

t.left(59) # moving left

turtle.done()

0 comments on commit 8e5d45d

Please sign in to comment.