what is the code to change the color of a turtle in Python?
PROBLEM SOLUTION CODE
import turtle
my_turtle = turtle.Turtle()
my_turtle.shape('turtle')
colors = ["brown", "orange", "purple", "red", "green", "blue", "black","yellow",]
for each_color in colors:
angle = 360 / len(colors)
my_turtle.color(each_color)
my_turtle.circle(40)
my_turtle.right(angle)
my_turtle.forward(30)
SAMPLE PROGRAM OUTPUT
Comments
Leave a comment