The program illustrates the use of conditional statements
Conditional statements are statements used to make comparison and decisions
<h3>How to write the program?</h3>
The program written in Python, where comments are used to explain each action is as follows:
#This gets input for the color
color = input("Color: ").lower()
#This checks if the input is red
if color == "red":
print(“Red light: you should stop.”)
#This checks if the input is yellow
elif color == "yellow":
print(“Yellow light: you should get ready.”)
#This checks if the input is green
elif color == "green":
print(“Green light: you should go.”)
#This checks for invalid input
else:
print(“Invalid")
Read more about Python programs at:
brainly.com/question/24833629
Good morning,
What Microsoft and Open Office have in common and that they both do is suggest better ways to present your data.
I hope you are satisfied with this answer and if you have anymore questions, feel free to ask. Have a good day!
..Grooves, or indentations in the rifles's barrel.
A wiki. (one example is Wikipedia)