-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2061 from Abhidongre/master
Colour spiral using python
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
Program's_Contributed_By_Contributors/Python_Programs/colour spiral.py
This file contains 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
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() |