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

remainder of 8529 divided by 42
A cable is 30 meters long. How long is the cable in decimeters? Be sure to include the correct unit in your answer.
Solve |4x – 5| = 9. Show each step of your work.
What is the smallest structure visible with a light microscope?
There are some flags hanging in a horizontal row . Starting at one end of the row the U.S flag in 25th starting at the order end of the row the U.S flag is 13th
Find three points that solve the equation, then plot on the graph -5x-3y=-7
Given that HOP is similar to TAG, which of the following statements must be true? Check all that apply. A. sin T = sin H B. cos P + cos G = 2cos P C
Ah, love, let us be true    To one another! for the world, which seems    To lie before us like a land of dreams,    So various, so beautiful, so new,    Hath
Find EC help me please
Find the quadratic function f(1) =-7 f(3)=-19 and f(3)= -49