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

Someone please help!!The circumference of a circle is 28pi meters. What is its radius?Show your work.
what are the parts of the animal cell
Find the radian measure of the central angle of circle with radius 1 yards that intercepts an arc of length 4 yards.
Please help me idk this
Which mixed number is equivalent to the improper fraction 22 7 ? 3 6 7 3 1 7 3 3 7 3 2 7
What is the effect on the graph of the function f(x) = 7x when f(x) is replaced with f(x) + 12? A) translates vertically 12 units up B) translates verticall
An english like programming language, such as java and c#, is called a ______ programming language .
How was the Inca Empire successful in uniting the diverse people in the conquered areas??
$10.95 Divided by 4/9
Why is the Scientific Revolution important to history?