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

When magma undergoes crystallization above ground, what type of rock results?
Will up-vote! What is 19.2 * 10^8 minutes in hours? A. 1.152 × 10^11 ​h​ B. 1.152 × 10^7 ​h C. 3.200 × 10^9 ​h​ D. 3.200 × 10^7 ​h​
trevor earned $826 on an account bearing 2.6 percent interest for 7 years How much money did he invest? (p)
Four trends in the past decade have significantly influenced the landscape of global marketing. one of them is
The answer to the problem?
How did the Muslims spread their religion? A. Crusades B. war C. missionaries D. faith
Hailey’s new puppy, sparky, weighed 4 pounds at six weeks old. if the puppy gains 2.5 pounds each month, after how many more months will sparky weigh 14 pounds?
What do children in the Netherlands use instead of stocking at Christmas time?
A 64 oz bottle of apple juice costs $2.39 and a 20 oz bottle cost $0.79 which is better to buy
What element is a gas with a mass number of 19?