Computer Science, asked by Anonymous, 10 months ago

How to make the following using Python turtle? Write the code.
Don't Spam!!!

Attachments:

Answers

Answered by AbhijithPrakash
9

Hi There,

This Is AbhijithPrakash,

The Figure is of the "Rainbow BENZENE"

Here is your code:

 

  1. # Rainbow Benzene
  2. import turtle  
  3. colors = ['red', 'purple', 'blue', 'green', 'orange', 'yellow']  
  4. t = turtle.Pen()
  5. #AbhijithPrakash
  6. turtle.bgcolor('black')  
  7. for x in range(360): #Code By ABHIJITHPRAKASH
  8.    t.pencolor(colors[x%6])  
  9.    t.width(x/100 + 1)  
  10.    t.forward(x)  
  11.    t.left(59)  

Attachments:

Anonymous: Thanks!!!
AbhijithPrakash: Welcome :)
Anonymous: ^_^
Answered by Anonymous
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)  


AbhijithPrakash: Great Answer dude!!
Anonymous: Thanks
Anonymous: Thanks
Anonymous: Welcome
Anonymous: ^_^
Similar questions