I would like to learn how to code this.
Here is how I want it to look
Do you want strawberry ice cream? (y:n) n
Do you want chocolate ice cream? (y:n) y
Do you want mint ice cream? (y:n) n
Do you want vanilla ice cream? (y:n) y
then the output would be: Here is your ice cream. or if you put N to all, You did not say yes to any.
Or with the else statement: I didn't get that, try again.
Any help is very much appreciated, thank you.
My test script:
def kind(chosenIce):
chosenIce=input("Do you want a ice cream (y:n) ")
if chosenIce1 == 'y':
ice1 = print("message")
if chosenIce2 == 'y':
ice2 = print("message")
if chosenIce1 == 'n':
ice1 = 0
if chosenIce2 == 'n':
ice2 = 0
else:
print("Sorry, I did not get that. Try again.")
kind(chosenIce)
chosenIcein the first line of the function? Where dochosenIce1andchosenIce2come from? What is supposed to happen fromice1 = print("message")?