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

Explain how you can round 25.691 to the greatest place
what angle do minute and hour hands of clock make at 9:00
Suppose you want to solve the equation 2a b=2a where a and b are nonZero real numbers describe the solution to this equation justify you description
what is 2,716 rounded to the nearest thousand
Scott is a young man whose body has trouble processing sugar. The BEST diet for him to follow is one that is __________. A. low in fat B. low in carbohydrates C
explain how to order a set of real numbers , like real numbers , integers, whole numbers and all that .
What is 6476 divided by 12
Why were the Appalachian mountains important to the colonies?
What is 10.6 as a fraction
ALGEBRA 30. The difference of three times a number and 4 is -19 32. The sum of twice a number and half the number is 10. 34. Four times the difference of a numb