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

What is the purpose of cell division
What is (70^2)/70+(70-70)?
¿En qué países el castellano se convirtió en el idioma predominante?
What is the solution set of the following equation? 6x^2 = 13x + 5 {-3, 2/5} {-1/3, 5/2} {5/3, -1/2}
a2 + b2 = c2 12 ft 16 ft O 28 feet O 24 feet O 20 feet O 14 feet
can you answer this one
aztecas nadie sabe por cierto de donde provienen los aztecas desierto del Mystik un lugar que nadie sabe dónde está llamado Aztlán algunas de las teorías lo sit
1. During WWII the U.S. and The U.S.S.R. were allies. But within a very short period of time, the US and the USSR had become suspicious of each other. What reas
You deposit $750 into an account that earns 8% interest, compounded yearly. How much money is in the account after 7 years (assuming you did not withdraw or dep
Can someone please help me with this