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

A flute plays a note with a frequency of 266Hz.What is the speed of sound if the wavelength is 1.3m? 102 m/a 205m/a 346m/s 692m/s
Aperture is controlled by what in the camera? Pentaprism Lens White balance Iris diaphragm
The prime factorization of 76 is _____. 2 · 38 2 2 · 19 2 3 · 7 76help please
?how does excess carbohydrate intake contribute to obesity?
what caused the american revolution
Two graphs are shown below: graph A shows scatter points 1, 2 and 2, 2 and 3, 2 and 4, 2 and 5, 2graph A shows scatter points 1, 11 and 2, 9 and 3, 7 and 4, 5 a
I just want to make sure I am right. Its Mathematics
What happens to the portion of the cell membrane that surrounds a large molecule during endocytosis? It forms a gap junction. It is stored for later use.
Who was partially responsible for plotting the Saint Bartholomew’s Day Massacre?
What is an example of an event that caused long-term historical effects?