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

I need to write an email to an elected official about a subject or question i have on an specific topic and i dont know how to start it instructions - "Tell the
how does the holocaust help us understand how people coped in life threatening situations
hi i rlly need help thx
Why does rawl reject utilitarianism.
Wars where china used iron and steel ancient china.
What is the answer to evaluate. 3³=___________________ Anyone Know
Resultant Force Forces with magnitudes of 125 newtons and 300 newtons act on a hook (see figure). The angle between the two forces is 45°. Find the direction an
Which statement describes the effect of adding more energy to a system, assuming a phase change does not occur? (1 point) O The particles within the system wil
What do you do if a heartbeat stops?
the real estate settlement procedures act of 1974 and its 1976 amendments provide what protection for people purchasing homes?