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

Improving muscular strength and endurance slows bone density loss.
Higher-frequency sound waves are perceived as having _____. A. higher pitch B. lower pitch C. higher volume D. lower volume
5 people share 3 bags of trail mix which fraction would each get?
aiden wants to find the mass of a bowling ball what unit of measurement would he use
29) The custodian of a company asset should a. have access to the accounting record for that asset b. be someone outside the company c. not have access to th
When do I use a comma in a long sentence? please help I'm always getting bad grades because if this and nothing is helping me .
what is the greatest possible perimeter of a 6 square centimeter triangle?
Fats are broken into saturated fats and unsaturated fats. Which of these explains the difference between saturated and unsaturated fats? A) Saturated fats hav
Relations between Armenia and Turkey are particularly bitter because of
What was Dr King's speech about?