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

NEED HELP ASAPHow does inflation relate to the rule of 72? How does saving money in an account with compound interest help protect you from inflation?
Is y/7 = 2/x direct variation?
There are 279 middle schoolers going on a field trip. An adult is needed for every 8 students. Me. Smith determines that 34 adults are needed for the trip. Expl
56% of the students who took the test were girls. There were 126 girls that took the test. Work out the total number of students that took the test.
Which religion is dominant in each of the given areas of Southeast Asia? Match each item in Column A to the answer in Column B. Indonesia East Timor 1. Roman Ca
Really confused on these types of questions. Could really use help
The coordinates of AB are A(-4,4) and B(2,1) which measurement is closest to the length of AB units
Find the value I in a formula P=IRT P=200 R=9% T=4 years
find the value of the following indice​
Find the area of the figure.