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

Sandy has box of chocolates. Box cost $2.00. In box has 8 chocolates. How much does each chocolate cost.
WHO WAS THE FIRST PRESIDENT IN THE UNITE STATES OF AMERICA
A person touches a hot surface with his hand and his hand springs back. Which two systems are operating?
If an investment is considered “volatile”, it means... A: the investment will experience rapid growth over time. B: the value of the investment may be hard to p
All of the following are characteristics of good leaders EXCEPT:
All dollar bills and coins are in example of
Find the missing value of a triangle one leg is 12 and the long side is 20 what is the other leg?
During the Civil War, it was legal in some states to own slaves, but not in others. It was argued when a slave was taken to a free state where slavery was not l
Which description of a factor that encouraged people to migrate to the United States in the mid 1800s
Which of these is a concave lens?