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

Solve for x. −3/4(x+2)=6 Enter your answer in the box
When were cucumbers born?
What is the number of moles in 15.0 g AsH3?
aye help asap pls !!! markin da brainiest too !!! btw da step choices are all add, distribute, divide, n subtract
How many brother does Francisco have in cajas de carton
PLEASE HELP, HISTORY!!!! During WWI, literacy tests were used to control immigration, which marked a return of what type of ideology in some Americans?
Can someone help me please!!
Some historians argue that the changes brought by industrialization caused Americans to beomce a more secular people. To what extent do you agree or disagree, a
Janice determined there were 10 possible outcomes when tossing two coins and spinning a spinner numbered 1 through 6. What is the correct number? What might hav
Solve each quadratic equation by factoring and using the zero product property. [tex]x^2+6x+8=0[/tex]