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 definition of valid
compare and contrast Afropop with another kind of music you know
A + B → C + D If there are 4 grams of product produced by the chemical reaction, how many grams of reactant were consumed? A) 0 grams B) 1 gram C) 2 grams D)
find the exact circumference of circle O.
Why woman are likely to become infected with hiv??
Sunnys gymnastics class last 1 hour 20 minutes the class starts at 3:50 pm at what time does rhe gymnastics class end
A good model of a cell membrane would be
Mt. Everest, the highest mountain in the world, is located in Asia. True False
During the first ____ year(s of life, a baby's brain will establish billions of new connections between neurons.
Why did native americans come to minnesota??