I was experimenting with what I have learned so far and I wanted to create something that is interactive, using raw_input().
What I wanted to do was creating a function that will create a conversation which will go different directions based on input. However, I was unable to figure out how to make a function accept the raw_input as its argument.
Here is the code that I've written;
drink = raw_input("Coffee or Tea?")
def drinktype(drink):
if drink == "Coffee":
#I WANT TO INSERT A CODE HERE THAT WILL CALL THE FUNCTION coffee(x)
elif drink == "Tea":
print "Here is your tea."
else:
print "Sorry."
x = raw_input("Americano or Latte?")
def coffee(x):
if x == "Americano":
return "Here it is."
elif x == "Latte":
return "Here is your latte."
else:
return "We do not have that, sorry."