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)
Step-by-step 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.