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

The two alternative forms of a gene are
please help what is the value of x
Think about the lab procedure you just read. Label each factor below with V for variable or C for constant Temperature of the gas: Volume of the gas in the syri
Select the correct answer The author suggests that all the decisions the crew made about the Apollo 11 patch were deliberate. How does the author's use of chron
Which sentence describes how romantic thinkers contributed to nationalist feelings in Europe? A. They tried to apply reason to look for solutions to political
Which three lines in this poem indicate that the poetic speaker refuses to be beguiled by love any longer?
The change in the angle of circular motion is analogous to ____ in linear motion
geometry help plzzzz
A verb form that functions as a noun is called a(n) gerund infinitive participle preposition
What is the best way to check for gas fumes after fueling a PWC?