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

NEED HELP ASAP 6th GRADE MATH JFJDJFJFJF will mark branist if corect
What happens to matter due to density.
Which feature would create the most fertile soil? a deposition b sand dunes c loess deposits d blowouts
Melanie is looking for a summer job. After a few interviews, she ends up with two job offers. (1) Blue Street Café pays $11.75 per hour plus $33 from tips each
Find the probability of drawing an ace and a king in either order
Which of these are the three parts of the SR2 technique? O A. Study, read, rewrite O B. Sentence, reading, recap C. Skim, review, rewrite D. Survey, read, revie
How were the lives of friars different from the lives of monks? a. Monks were teachers; friars were not. b. Friars were allowed to marry; monks were not. c. Fri
please help Explain how independent and dependent variables apply to life
How have the roles and purposes of photojournalists evolved during the past century?In what ways can the public rely on photography to tell the “truth” about hi
Yall kids better be in school to get your education