
Un petit robot traverse la route. Écris traffic(light) : "red" renvoie "stop", "yellow" renvoie "wait", "green" renvoie "go". Tout le reste (un feu en panne) renvoie "careful".
traffic("red")→'stop'traffic("green")→'go'def traffic(light):
if light == "red":
return "stop"
# ton code ici: yellow, green et tout le reste
pass
Exécuter teste les exemples. Quand ils sont bons, appuie sur Envoyer.