Anonymous9865 Anonymous9865
  • 02-09-2020
  • Computers and Technology
contestada

Write a program to output the signal status based on the signal colour taken as input.
SIGNAL COLOR SIGNAL STATUS
RED STOP
YELLOW WAIT
GREEN GO

Respuesta :

tonb
tonb tonb
  • 02-09-2020

Answer:

colour = "YELLOW"

signalMap = {  

 "RED" : "STOP",

 "YELLOW" : "WAIT",  

 "GREEN" : "GO"

}

print(colour + " means " + signalMap[colour])

Explanation:

Since python doesn't have switch statements, this map is a useful alternative.

Answer Link
ssheikha911
ssheikha911 ssheikha911
  • 02-09-2020
What subject is this
Answer Link

Otras preguntas

A tree is 100 feet tall casts a shadow that is 150 feet long . Determine the angle at which the rays of of tge sun hit the ground , to tye nearest degree
Help me plz idk how to do this :)
As a young monk, luther: was fearful that he could never do enough good deeds to deserve salvation. believed that a corrupt church could not save his soul. avoi
Question 12 Unsaved Conceding a point is a strategy that writers sometimes use in persuasive essays. When writers concede a point, they _______________________
in which layer of the atmosphere do communication satellites orbit Earth?
Which system of inequalities is represented by the graph?
Why are Noble gases inert? A. They cannot form bonds because they have 0 electrons in their valence shell. B. They are actually so reactive that they bond
At 7 degrees Celsius the volume of gas is 49 liters. At the same pressure its volume is 74 mL at what temperature
how much pesticide will each snake take in compared to each grasshopper
the sum of two numbers is 7 five times the larger number plus four times the the smaller number is 47.