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

A bag of trail mix weighs 1.625 pounds. Round 1.625 to the nearest hundredth. please guys give me correct answer i am doing a exam
What is the solution of the equation 13 + b = 37? b=
instability in China during the three kingdoms period was a primarily result of what?
HELP ASAP ILL GIBE BRAINLIEST IF U ANSWER CORRECT Directions: Write a sentence for the following word. Make sure that the sentence contains a context clue. Adv
During this musical period, the music is referred to as "Absolute Music." The Classical Period Renaissance Period Medievel Period The Romantic Period
We should study in economics ?
How much Ag can be produced if one is given 64 g of Ag2O?
Today, 198 people went to Six Flags the first hour it was open. This number was 30% of the number of people who went to the park yesterday. How many people went
16 .Write an equation that represents the statement below. "Twelve less than a number, x, is 18."
which of the following best explains one goal of the axis powers?