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 happens to inflation and unemployment in the long-run phillips curve if the fed increases the growth rate of the money supply?
A client diagnosed with kidney stones is experiencing a urine output decrease of less than 0.5ml/kg per hour; increase bun and creatinine levels; decrease glome
The ability to anticipate a fraud perpetrator’s likely method of concealing a fraud is called?
Find the cube root of Z =1+i the power of 5​
The fixed assets turnover ratio of gd products is 13. 6 and that of its competitor, ap goods inc. , is 6. 0. what does this financial data primarily imply?
find the length of the semi-major axis of the ellipse x^2/49+y^2/36=1
in the secret lifeof bees, do you trust the author? why or why not?
When you plan a nutritious meal, what is the order you should keep in mind? Why is this important to keep in mind?
In addition to the urethra, this muscular duct travels through the prostate gland:________
Which is one reason that sociologist cite to explain why men and women are delaying?