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

2. What is the view point of a Patriot? (pg.69)
help me for hawaiian history if anybody knows ?
Which of the following means "each branch exercises some control over the other two"? A. Separation of powers B. Checks and balances C. Individual rights D. Fe
HELP ME PLZZ I NEED HELP
what country is this? espanolas espanoles alemanes alemanas
An equilateral triangle is shown below. What is the value of x?
The word that means sweet produce is ?
if you were a modern day giuseppe arcimboldo what would you use to create you art? why?​
Factor -6 out of 12y - 42. Need this ASAP!!!
Three-fourths of a number is greater than or equal to nine less than a number.