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

Read the lines from "Because I Could Not Stop for Death." And I had put away My labor and my leisure too, For His Civility – What is the purpose of the words
The cellular process in which materials are moved across a membrane from an area of low concentration to an are of high concentration is called
Which organelle is responsible for carrying out the process of photosynthesis and producing surgars for the plant cell?
160 bananas; 20% decrease
what expression shows how to break apart 5×617
What were the roles of men and women in Jewish society?
I have to write the following expression in simplest form 7p-1-9p+5
what is the answer to... evaluate a+b when a= -15.4 and b= -13.5
Evaluate. 2³ + 4 ⋅ 2 − 7
Mike observed that 75% of the students of a school liked skating. If 35 students of the school did not like skating, the number of students who liked skating wa