How to make the following using Python turtle? Write the code.
Don't Spam!!!
Attachments:
Answers
Answered by
9
Hi There,
This Is AbhijithPrakash,
The Figure is of the "Rainbow BENZENE"
Here is your code:
- # Rainbow Benzene
- import turtle
- colors = ['red', 'purple', 'blue', 'green', 'orange', 'yellow']
- t = turtle.Pen()
- #AbhijithPrakash
- turtle.bgcolor('black')
- for x in range(360): #Code By ABHIJITHPRAKASH
- t.pencolor(colors[x%6])
- t.width(x/100 + 1)
- t.forward(x)
- t.left(59)
Attachments:
Anonymous:
Thanks!!!
Answered by
2
import turtle
colors = ['red', 'blue', 'aqua', 'green', 'orange', 'yellow']
t = turtle.Pen()
turtle.bgcolor('black')
for x in range(360):
t.pencolor(colors[x%6])
t.width(x/100 + 1)
t.forward(x)
t.left(56)
Similar questions