import turtle wn = turtle.Screen() # create window for turtle t1 to draw wn.bgcolor("black") # set background color of the window colors = ["yellow", "red", "blue", "pink", "green"] t1 = turtle.Turtle() t1.shape("classic") # t1.color("yellow") t1.width(3) for i in range(20): t1.color(colors[i%4]) # set line color before drawing a line forward t1.forward(i * 10) t1.right(90) wn.mainloop() # wait for user to close the window