If the user has inputted 'tea' or 't' as their choice, how do I define the variable beverage.lower() as 'tea'? Because of the
if beverage.lower()=='t'or beverage.lower()=='tea':
beverage.lower()=='tea'
line has absolutely no whatsoever effect on the overall program itself?
while True:
beverage=raw_input("What is your preferred beverage: coffee, or tea?")
if beverage.lower() not in ('coffee','tea','t','c'):
if beverage.lower()=='t'or beverage.lower()=='tea':
beverage.lower()=='tea'
elif beverage.lower()=='c'or beverage.lower()=='coffee':
beverage.lower()=='coffee'
print("Sorry! I didn't quite catch that. Please try again! (Note that you can use the letter 'c' or the letter 't' to denote coffee or tea respectively!)")
continue
else:
print("Ah! Fantastic choice!")
break
Likewise, how would I go about defining the user inputted beverage.lower() as another variable?
beverage.lower()means you call the methodlower()of the instance of the string class. So you can do what you want.beverage = beverage.lower()