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

Does supply-side economics work? Why or why not?
Profit-maximizing firms enter a competitive market when existing firms in that market have.
The household refrigerator fresh-food compartment is a good example of ____ refrigeration
Fuel crises will occur in future because of a. over use of petroleum b. use of solar energy c. over use of bio-gas d. use of hydro-energy​
30% of 70 is what percent of 2000?
Given MTS and SQP, find sq
Which clinical finding represents a contraindication to the administration of nitroglycerin?
The household refrigerator fresh-food compartment is a good example of ____ refrigeration
Please help, need for hw and cant find the fourth degreee
what is both a right and responsibility for citizens who live in a democracy