hw 20/3/25 11:31 AM
This commit is contained in:
parent
41aa105ca1
commit
d91b49ddcb
3 changed files with 65 additions and 0 deletions
12
py/MoreIfStatements/challenge4.py
Normal file
12
py/MoreIfStatements/challenge4.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Ask the user to select a color
|
||||
color = input("Select a color (red, green, or blue): ").strip().lower()
|
||||
|
||||
# Check the user's input and display the appropriate message
|
||||
if color in ["red", "r"]:
|
||||
print("You selected red.")
|
||||
elif color in ["green", "g"]:
|
||||
print("You selected green.")
|
||||
elif color in ["blue", "b"]:
|
||||
print("You selected blue.")
|
||||
else:
|
||||
print("Incorrect choice.")
|
Loading…
Add table
Add a link
Reference in a new issue