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

Question:6 ...................................
Provide a clear answer while explaining how to do each step to the question below: Which of the following expressions are equivalent to [tex]\sqrt[3]{8x^5y^7}[/
Which ordered pair (a, b) is a solution to the given system of linear equations? mc010-1.j pg (1, 7) (3, 1) (11, –23) (23, –11)
what three issues did europe face after the war
A lottery uses balls numbered 1 through 37. List the sample space of the event picking one even-numbered ball.
What does internal and external conflict mean?
HELP PLEASE!!! U is the set of positive integers less than 18. G is the set of positive factors of 12. What is the complement of set G in universe U.
are penn foster highschool proctored exams optional?​
SAT Math Question (Thanks!) f(x) = x^2 - 2x + 8 g(x) = -x^2 +18x +4 The two functions defined above are equal to each other when x=5+a or x=5-a, where a is a c
2 Points You slide across a wooden floor in your socks. There is a normal force of 950 N acting on you, and the coefficient of kinetic friction is 0.65. What is