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

Jenya paid $40 per month for a cell phone plus $1.25 for each international text message she sent. She sent 50 international text messages in a month. What was
What's number is 35% of 20
How did Alexis de Tocqueville feel democracy affected women? a. They are more focused on maintaining a submissive role. b. They are less inclined to feel the
759 ÷ 94, 653 ÷ 74 , 257 ÷ 36 thanks for all your help
What was a key element in developing a market economy in nineteenth century america A) creating a system of toll roads to generate a federal revenue B) Improvi
The idea of "conversion" is best explained as which of the following? The process of cultural change brought about by immigration The process of changing the fr
What is the halving and doubling strategy
When deciding on a foreign language to pick you should think the benefits it will bring you in the future? True or False
Why did Thomas Jefferson financed the expeditions of Lewis and Clark and Zebulon Pike?
Which word suggests private thought? a. introspection b. repartee c. repose d. vigil