darshani45 darshani45
  • 25-02-2021
  • Computers and Technology
contestada

help!! write the python code

help write the python code class=

Respuesta :

tonb
tonb tonb
  • 25-02-2021

Answer:

import turtle

t = turtle.Turtle()

t.speed(0)

t.pendown()

colours = ["yellow", "blue", "red", "orange", "cyan", "pink", "green", "brown"]

for x in range(1,10):

 t.pencolor(colours[x%len(colours)])

 for i in range(4):

   t.forward(20*x)

   t.right(90)

Explanation:

I made it such that you can add or remove as many colours as you want in the array, if there are more lines than colours it starts at the beginning again.

Answer Link

Otras preguntas

how many moles are in 9.8 grams of calcium?
The students who went to summer camp voted for there favorite activities how many more students voted Viking than for fishing 21 biking who voted 9 fishing peop
The Lees have 3 children. The oldest is twice as old as the youngest. The middle is 5 years older than the youngest. If the sum of the age is 57, how old is eac
Should I write countries' fuel or countries's fuel
What was Jefferson’s official position regarding the Napoleonic Wars?
Why am I so annoying? How can I change myself?
Should I write countries' fuel or countries's fuel
name and describe the cell structure that helps prevent damage to certain cells when they are subjected to high osmotic pressure
Narrative paragraph example
What was Jefferson’s official position regarding the Napoleonic Wars?