Answer to Question #252177 in Python for Angelie Suarez

Question #252177

what is the code to change the color of a turtle in Python?


1
Expert's answer
2021-10-16T11:03:16-0400


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



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS