
A little robot crosses the road. Write traffic(light): "red" returns "stop", "yellow" returns "wait", "green" returns "go". Anything else (a broken light) returns "careful".
traffic("red")→'stop'traffic("green")→'go'def traffic(light):
if light == "red":
return "stop"
# your code here: yellow, green, and anything else
pass
Run tries the examples. When they look right, Submit.