ch03
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
flavors = ["pistachio", "malaga", "vanilla", "chocolate", "strawberry"]
|
||||
prompt = "Choose your flavor: "
|
||||
|
||||
print(flavors)
|
||||
|
||||
while (choice := input(prompt)) not in flavors:
|
||||
print(f"Sorry, '{choice}' is not a valid option.")
|
||||
|
||||
print(f"You chose '{choice}'.")
|
||||
Reference in New Issue
Block a user