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

Which noun has the highest level of concreteness? a. Building b. Structure c. The Empire State Building d. Skyscraper
one side of a square is 7cm what is the area
The main difference between a nation and state is that a nation is an example of an imagined political
Lily Quinn makes $12.50 and hour. She works four hours on Monday, six hours on Tuesday, nine hours on Wednesday, three hours on Thursday, and seven hours on Fri
If you have 10.0 g of a substance that decays with a half-life of 14 days, then how much will you have after 42 days? a. 0.10 g b. 0.31 g c. 1.25 g d. 2.50 g
What country acquired atomic weapons next after the United States? a. China b. France c. North Korea d. The Soviet Union
Electromagnetic waves can transmit energy through a vacuum. True False
What is 32% of 5 million?
A group of 18 people ordered soup and sandwiches for lunch. Each person in the group had either one soup or one sandwich. The sandwiches cost $7.75 each and the
What is the completely factored form of 3x^2-12x-15