Write a program to output the signal status based on the signal colour taken as input. (PYTHON)
Signal colour———Signal status
Red ————————Stop
Yellow ———————Wait
Green ———————Go
Sample output—————>
Enter signal colour : Red
Enter signal status : Stop
IT IS “PYTHON”…..PLEASE HELPP
Answers
Answered by
1
Answer:
x= signal colour
a= stop
b= wait
c=go
print(a,b,c)
Answered by
1
Answer:
Once the colour has been entered, we use conditional statements to test for each possible colour. A conditional statement is used to check for a given requirement or condition. In this case, the conditions are trying to figure out which colour the user could've entered and accordingly proceeding with the output. If the colour is Red, it will print STOP. If not, it will move to the next condition, which is Yellow. If it's Yellow, it will print WAIT and the same thing happens for Green as well.
Similar questions
Math,
21 days ago
Environmental Sciences,
21 days ago
Science,
21 days ago
Science,
1 month ago
Math,
1 month ago
Science,
9 months ago
Psychology,
9 months ago