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

How did the US change socialy between 1776 and 1870?
The Aztecs established an empire in _____.
10 times as many as 1 hundred is how many hundreds
X is at most 30 so whats the answer
The lovin lemon company sells a 4 gallon jug of lemonade for $24. the sweet and sour company sells an eight pack of 1quart bottles of lemonade for $16.00. which
What was the "Era of Good Feelings"? a time when Americans moved West a time when there was little political strife a time when Federalists held political power
The distance from Baltimore to New York is about 171 miles this is about 189 miles less then the distance from Baltimore to Boston how far is Baltimore from Bo
Which statement is true for single-celled organisms? A. They are often harmless. B. They always cause disease. C. They only live inside
what is 423,090,709,000 in word form?
writing in math use counters tell how to make 10 when adding 8 5