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

Difference in fresh or frozen fecal microbiota transplant for recurrent c diff infections ncbi
The major difference between the equation for a hyperbola and for an ellipse is the operation performed. the terms in the equation of a(n) _____ are subtracted
1/6m=5/8 i can't slove this question 8th Grade Math
That some individuals are exceptionally intelligent in mathematical ability but have great difficulty understanding social interaction, lends support to which t
What are some repercussions of not addressing this environmental risk factors?
Geometry math question please help
What is 1+1? lol i know it’s 2
Help please ASAP!!!! I NEED CORRECT ANSWERS ONLY FOR BRAINLIEST
Applying the concept. Distance formula/ midpoint formula. Not sure how to figure this one out. or if I need to use one of the formulas.
Need answers pls and work is helpful