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

Your family hosts an exchange student for the summer. this student becomes extremely upset (i.e., distressed) after receiving a bad grade on an exam. in fact, h
Which unit of measure is most appropriate for measuring the area of a driver's license
11 12 Which statements about Outcasts United express theme? Check all that apply. Jeremiah’s mom is overprotective. being new to a country One person can hel
Match each linear equation with its slope and a point on the line. (the top row label 1-5 and the side column a-d)
What additional skills, training, or experience do you bring to hot topic?
The milky way galaxy is most likely an example of which type of galaxy?
Why would a red apple appear black if you looked at it through a blue filter?
Why was it possible that lincoln would not be reelected in 1864?
Alcoholic fermentation produces ethyl alcohol. This process also
Question: Which best describes Antarctica? Answers: A.It has a population of about t