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

Bacteria are very small single-celled organisms that lack a nucleus. Although bacterial cells are less complex than the cells that make up the human body, bacte
Why did some Tejanos support the fight against the Mexican Government?
Is energy in fossil fuels is derived from the energy stored in plants and animal matter?
What happens to a white light passes through a prism?
It is possible to have what would be considered contradicting personality traits. true or false
What part of the body must Cupid's arrows hit to be effective?
Which part of the atom is directly involved in chemical changes? A. the electron B. the energy levels C. the nucleus D. the charges
¿Que es la humanización?
How were the independence movements in Vietnam and Kenya similar? Both nations achieved independence from British rule. Both movements involved violent conflict
Montañas altas de Sudamérica?