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

which table contains ordered pairs that lie on the same graph of the equation -2x + 4y equals 16
How do I find linear systems for the graph
What can you infer from the fact that historians think the Treaty of Versailles might have led to WWII? A.The penalties of the treaty imposed on Germany were to
Why do so few organizations give human resource planning a high profile?
Why does it seem that the Sun is rising and setting in the sky?
Heart disease is a noncommunicable disease because it can be spread. it can be influenced by lifestyle factors. it is contagious. it only affects individuals, n
What multiplies to -36 and adds to 5
if a square has a perimeter of 64 inches. What is the length of one side.
Jack and Walter work in a store's gift-wrapping department. Jack can wrap 28 boxes in 2 hours, while Walter takes 3 hours to wrap 36 boxes of the same size. One
1241 divided by 43 what is the answer and work