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

Adding commas worksheets
Simplify the function f (x) = f(x)= 1/2 (27)^ 2x/3. Then determine the key aspects of the function.
Which of the following is an example of negative correlation? a. People who spend more time exercising tend to weigh less. b. Teenage females tend to have fewer
Explain why the colonists rebelled against Britain
A 13.6- resistor, an 11.9-μF capacitor, and a 19.1-mH inductor are connected in series with a 117-V generator. (a) At what frequency is the current a maximum?
For the data set below which of the following measures is greatest? 3,3,4,5,6,8,16,20
Which of these is the best example of a cause-and-effect chain of events?
Choose the translation that best fits the expression: − 1 6 + 3x − 2y Negative one-sixth plus three times x minus the sum of 2 and y. Negative one-sixth times x
which of the following statements is true of work flow analysis?
Beth needs to fertilize her flowerbed, which is in the shape of a regular pentagon. A bag of fertilizer states that it can fertilize up to 150 square feet, but