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

The second-closet planet to the sun,it is also classified as a terrestrial planet and it is sometimes called Earth's "sister planet" because the two are similar
Match the vocabulary word with its meaning. 1. literacy the political orientation of those who hold that a republic is the best form of government 2. republica
Define buffer capacity. a.buffer capacity is the amount of acid or base that can be added to a buffer without destroying its effectiveness. b.buffer capacity is
How does atom electronegativity affect bond character and molecular polarity?
Compare and contrast auschwitz and manzanar??
What major conflict of the play is introduce in Act 1?
what does an energy efficiency expert do?
how many dollars are in 65536 Penney's
In Southern Europe, most people live in coastal plains and river valleys. Please select the best answer from the choices provided T F
WHAT IS THE GCF OF THE POLYNOMIAL 8x6y5 - 3x8y3