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

What all the multiples of 81?
The inner and outer Radii of a cylindrical pipe are 5 cm and 4 cm respectively. find the area of cross section of the pipe.
Thelma spent 1/6 of her weekly allowance on dog toys.  1/4 on a dog collar and 1/3 on dog food.  What fraction of her weekly allowance is left
What all the multiples of 81?
What is 25% of $500.00? I think the answer is $475.00 Can someone verify if twenty five percent of 500.00 is $475.00
What were the contributions of the Harappan civilization?
Forget the motor When im on the boat Think of the best time To buy a new coat What am I......?
josh wanted to buy a bicycle but didn't have enough money. After josh told his troubles to sam slick, sam said,"I can fix that. see that fence? each time you ju
Does an owl have a backbone?
Factor the expression. If the expression cannot be factored, say so.