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 Enlightenment ideas influence modem beliefs about the importance of education?
A spinner is divded into two equally sized sections. The sections are labeled STOP and GO. S represents STOP and G represents GO. The spinner is spun twice. Wha
If the volume of a rectangular prism is 200 cubic units, and the area of the base is 16 square units, what is the height of the prism?
name this compound Ch3ch2ch2cooh​
Who is on American side in World War I
Please help me out!!!!!!!!!!
Please help me!!!!!!!!!!!!!!!!!
Solve the equation below for x.| 2(x+5)= 3(x-4)​
Jeff’s father is installing a do-it-yourself security system at his house. He needs to get a device from his workshop that converts electric energy to sound ene
Can you guys help me I don’t really understand area that well