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

function form 5x-7y=14
Find three consecutive numbers whose sum is 138 by writing and solving an equation
3x+y=5 , 2x-2y=22 solve the system of equations by the addition method
what two factors determine the thermal energy in a substance
Can anyone help me with this
In what way does the executive branch check the powers of the legislative branch?
Christina estimates that she will spend $250 on you summer clothes . She actually spends $350 . What is the percent error .
What did Adam Smith say should determine the cost of goods?
Which of the following required all states to return fugitive slaves to their owners? a) the great compromise b) the Connecticut compromise c) the three-fift
a sample of dna conains 500 adenine bases. how many thymine bases does it contain