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

Find the value of m,if the distance between A(2,-1) and B(m,-5) be 4√2 units[tex]d = [/tex]​
List one method of testing a product quality
According to CA law, who are forbidden from using a cellular phone including hands-free devices while driving? 1) Only teenagers 2) Only adults 3) Both teenager
How to Evaluate the Expression : -3.75-(6 1/4)
50 POINTSSSSProve It[tex] \frac{sin \frac{a}{2} + \sin(a) }{1 + \cos( \frac{a}{2} ) + \cos(a) } [/tex][tex] = \tan( \frac{a}{2} ) [/tex]​
Elmer bought 4 pens for $1.96. What was the cost of each pen? Let p= the cost of each pen
Which 2 triangles can be proven similar by AA~?
The first worker completes a task 4 hours earlier than the second worker. First they worked together for 2 hours, then the first worker worked alone for 1 hour.
Multiply 5x2(2x2 + 13x − 5).
vigyan doctor 3 meter kise kahate Hain​