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

Twelve pounds less than twice janes weight is 270 pounds. What is Janes weight?
The scientific theory that describes the beginning of the universe is called the a. Expanding universe theory b. Contracting universe theory c. big bang theor
Evaluate each expression 9 cubed
If 200 beads cost 48 dollars how much does 25 cost
When France fell to the Nazis in 1940, President Roosevelt issued the first-ever ________ draft. A. wartime B. nationwide C. peacetime D. selective
can Fresh fruit be contaminated by the water used to wash it.
how to simplify 81 1/2
how do you rename 720 tens
Any condition in an experiment that can be changed?
When France fell to the Nazis in 1940, President Roosevelt issued the first-ever ________ draft. A. wartime B. nationwide C. peacetime D. selective