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

The "Muckraker" journalists would have been likely to cover all of the following subjects EXCEPT
why do prokaryotes need to be able to regulate their metabolism quickly?
approximately how many new rice consumers will be added in asia in the next 10 years
What price should a retailer place on an item that costs him $6.95, if he wants a markup of 33%? $
10/3 / 1/6 - (2.8 + 1.2)
Help me with this question
Zoe is solving the equation 3x – 4 = –10 for x. She used the addition property of equality to isolate the variable term as shown. 3x – 4 = –10 3x – 4 + 4 = –10
Which option accurately describes catholic theology and practices in the middle ages?
the process of rebuilding the society and the governments of the southern states after the Civil War
Hey guys, I'm just looking for good inspirational topics to write a poem about. If you have tips on writing poems, feel free to share it with me. I really want