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

Please help need answer please
What is the Commonwealth of Nations?
Which expression is equivalent to.
HELP ASAP!! GIVING BRAINLIEST! What are the steps for constructing an inscribed circle in angle ABC using only a compass and a straightedge?
What did Hideyo find out as he escaped the factory
Solve the system of equations and choose the correct answer from the list of options 2x + y = -4
Min's hose can pump 21 gallons of water every hour. How many gallons of water will he fill up if he runs the hose for 2/3 of an hour?
which of the following subject lines would be best to use when applying for a position in a high school teacher a. teacher job b. Blank subject line c. Re:
Please help me with my homework
The formula for the volume of a sphere is V=4/3nr3 . What is the formula solved for r