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

1. Why are there active volcanoes along the Pacific coast in Washington and Oregon but not along the East coast of the United States?
In Romeo and Juliet act 2, which character serves as a messenger
a person who studies word origins and meanings would most likely be a
Why do Andhra Pradesh donot recive any snow fall during during winter months. PLEASE HELP.....EXAM TOMORROW
2(n-3)=4n+1 this sucks not knowing the answer
Why do Andhra Pradesh donot recive any snow fall during during winter months. PLEASE HELP.....EXAM TOMORROW
One way to show that a statement is NOT a good definition is to find a _____ converse.conditional.counterexample.biconditional.
1. Why are there active volcanoes along the Pacific coast in Washington and Oregon but not along the East coast of the United States?
I = {1, 2} List all possible subsets of the given set.
Write this statement as a conditional in if-then form: All triangles have three sides. A) If a figure is a triangle, then all triangles have three sides.B) If a