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

What is the place value of the 4 in 1,453,897
mrs. jones behavior right after roger tries to rob her in thank you ma'm shows her to be
Which word in the sentence is the direct object? We met her at the county fair last night. a. county b. night c. her d. fair
The temperature at 6:00 a.m. was –12°F. By 3:00 p.m. the temperature had risen 21°F. What was the temperature at 3:00 p.m.? A. –33°F B. –9°F C. 9°F
10.261 divided by 3.1
when did the war change from a battle over preserving the Union to a war to end slavery
Why is graphite softer than diamond
In a list of numbers, the pattern increases by 0.001 as you move to the right. If the third number in the list is 0.064, what is the first number in the list? E
How are the two 4s in the decimal 0.44 related
Whats the similarity between biosphere and ecosystem