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

Select all expressions that are equivalent to 2x + 5(–4x + 10) - (x + 4). Show your work in the sketch pad that supports your answer. (Select all that apply.) 2
apply the Pythagorean theorem to find the distance between two points (to the nearest tenth). which statements are correct
Solve each inequality. Then compare the solutions. 2x + 13 < 19 - 4x + 23 < 11 2x + 13 < 19 x
Help please this is the only question I need
-30 = -5 Pls help ...
Use the figure below to find the value of x and yº.
What are trade unions?
which of the following are allied powers? A. Italy B. England C. Germany D. Japan
what do you know about states of matter? PLEASE ANSWER CORRECTLY.
explain the various waves of immigration to the United States. What groups were part of each of these waves?