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

5. On average, how many years earlier do smokers die than nonsmokers? (Points : 1) 5 to 6 10 to 11 13 to 14 19 to 20
Failure to incorporate _______ can easily lead to _______. Would the answer be: citations, plagiarism?
who fought against each other in the crusades?
what is the position of 9 in the number 932,805? A. The ten-thousands place B. The hundred-thousands place C. The hundreds place D. The ones place
how do i find the angles on a kite?
what's the percentage of 1/8 ?
Aiden wrote a riddle: Five less than 1/5 times a number is same as the sum of the number and 1/3. Find the number
Help pl0x, Algebra 1
Explain why applying a vertical translation and then a horizontal translation produces the same result as applying a horizonatal translation and then a vertical
the bombing of Hiroshima and Nagasaki resulted in