Python:
light_color = input("What is the color of the traffic light? (red, yellow, or green) ").lower()
if light_color == 'red':
action = "Stop"
elif light_color == 'yellow':
action = "Slow down and prepare to stop"
elif light_color == 'green':
action = "Go ahead"
else:
action = "Invalid color - please enter red, yellow, or green."
print(f"The light is {light_color}. You should: {action}")