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 with whatever you can !!!!!
if 2/5 divide by 2 1/3 = 6/35, then 6/36 times by 2 1/3 =?
Help with 19 and 20 please thank you!
Joel earns a commission of 5% on the audio equipment he sells , and the store keeps the rest . He sells a $750 amplifier. A. How much commission does Joel earn
put these numbers from least to greatest? 2.7,0,1.3,1,2
answer my question plzz !!any body
Cultural conflict you have observed??
pls pls help me please!!!!
1. Any body of surface water in which water is stored is a(n) aquifer reservoir channel floodplain 2.Which of the following is a source of groundwater replen
Harold had 1,400 stamps. He gave 350 of them to his brother and the rest to his sister.What percent of the stamps did he give to his brother?