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 are continental glaciers different from valley glaciers?
Which of the following shows a correct Lewis dot structure
There are 6 woman running in a race. how many different ways could first,second, and third place finishers occur
If the measure of angle 2 is represented by 6x + 8 and the measure of angle 6 is represented by 8x - 6. What is the value of x?
Where can hiv-infected patients and their families find resources?
How does grassroots lobbying differ from other efforts by interest groups to influence government?
The geography and the economy of the southern states in the years leading up to the civil war is described by question 11 options: they controlled all of the na
In the drummer boy of shiloh, what does it mean when joby turns his drum to the sky
Prominent supporters of the constitution, who defended that document during ratification through published articles in papers across the nation, were known as
whats is the fourth term of (a-b^2)^5