79610804

Date: 2025-05-07 14:42:45
Score: 1
Natty:
Report link

Based on @KRoscoe45's answer but with a bit of error handling :

import turtle as trtl
troll = trtl.Turtle() 

color_list=["blue","red","pink","black","white"]
wn = trtl.Screen()

clr = input("give a color pls: ")
while not crl in color_list :
    input(f"Color must be part of this list :\n{color_list}.\nPlease reenter one:\t")


wn.bgcolor(clr)
wn.mainloop()

This would handle error caused if the user dosn't enter a color that is understandable by the turtle module by reasking for a color until the answer is part of color_list.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @KRoscoe45's
  • Low reputation (1):
Posted by: rnd_name