Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

complete this table: score final grade explanation 95 a (\you passed!\)…

Question

complete this table: score final grade explanation 95 a (\you passed!\) 85 b (\you passed!\) 73 c (\you passed!\) 67 d (\you need to retake\) 42 f (\you need to retake\) practice exercise 6: traffic light logic write an elif chain for a traffic light system: if light is
ed\: print \stop\ if light is \yellow\: print \slow down\ if light is \green\: print \go\ if light is anything else: print \light malfunction\ python light_color = partner provides:
ed\, \yellow\, \green\, or \blue\

Explanation:

Step1: Write the Python code with ELIF chain

light_color = input("Enter the traffic - light color: ")
if light_color == "red":
    print("Stop")
elif light_color == "yellow":
    print("Slow down")
elif light_color == "green":
    print("Go")
else:
    print("Light malfunction")

Answer:

light_color = input("Enter the traffic - light color: ")
if light_color == "red":
    print("Stop")
elif light_color == "yellow":
    print("Slow down")
elif light_color == "green":
    print("Go")
else:
    print("Light malfunction")