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

A local target store bought 122 pizzas at pizza hut for its holiday party. each guest ate 1/4 of a pizza and there was no pizza left over. how many guests did t
Why do people today think the federalist papers are important?
How are equal area projections of earth inaccurate?
4+(-2) please help me I could use it
How to solve this problem
The length of a rectangular carpet is 4 feet greater than twice its width. If the area is 48 square feet, find the carpet’s length and width.
Why does the legislative branch of the government represent the people most directly? what is the principal job of this branch?
ASAP Show work!! 3/7w - 11 = -4/7w
PLEASE HELP Which system of inequalities has no solution? A. x+3y is greater than or equal to 0.5 x+3y is less than or equal to 2.5 B. x+3y is great
What advice would you give to someone that just discovered that they have a sensitivity to gluten?