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

High fat diets contribute to the risk of Group of answer choices Type 2 diabetes Cancer Heart disease All of the above
What is the kinetic energy of a moving toy car if the car has a mass of 15.0 kg and the velocity is 7.2 m/s ? ______ J
What property does Line A use? A. distributive property B. commutative property C. addition property of equalityD. division property of equalityE. subtraction p
what is a humorous imitation of a popular literary style, genre, or author called?
What is the name of the building above?
Grayson needs to order some new supplies for the restaurant where he works. The restaurant needs at least 761 forks. There are currently 205 forks. If each set
(PLEASE HELP) Find the area of the parallelogram. Found to the nearest hundredth if necessary.
Algebra 1 please help!
how are some ways Chrisianity Inpact idenity?
What action causes the first heart sound heard through a stethoscope?.