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

Find the vertex form of a parabola with a vertex of (-2, 12) that passes through (-4, 0)
Essay about my favorite character
Can you please help me and answer both questions please
Anyone please help me with those 2 questions!
8x² +14 x² -x +35 : 2x+5 Decide​
Which of these statements is true? The premiums for term life insurance are higher than cash value insurance premiums. The premiums for term life insurance are
I don’t get the second question.
A women who normally weighs 400 N stands on top of a ladder so high she is one full additional earth radius above the surface of the earth. How much does she we
Help me out.....30Pt. When a Country needs External/Foreign Debt? Relate it o State bank reserve of that country and other things
The Texas department of public safety issues drivers licenses and identification cards that have specific security features. A valid drivers license issued afte