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

If no file specification of a web page is specified in the web address, a default web page is displayed a. True b. False
Rearrange formula A=r2 For r
What is the radius of a circle whose area is 36π cm^2 (to the second power)
While shopping for clothes, Tracy spent $50 less than 3 times what Daniel spent. Tracy spent $40. Let x represent how much Daniel spent?
In which way did the ideas of the enlightenment influence the French Revolution
What is a Trajineras?
should mp3 music be free cons
Why is the upper layer of desert soil rich in minerals?
what is the expanded form of 3×(x+3)^2
¿Qué están haciendo? Somos jugando fútbol. Estamos jugando fútbol. Está jugando fútbol. Estás jugando fútbol.