我得到错误信息“NameError:名字‘酒’没有定义”每当我运行下面的代码:的Python 2.7的错误:名称“酒”是没有定义
def pub():
print ("Welcome to the pub; what will you be drinking tonight?")
answer = input("Choose the type of beverage you desire")
if answer == " Beer" or answer == " beer":
print ("You've come to the right place; have a seat!")
elif answer == " Wine" or answer == " wine":
print ("Sorry, we don't serve wine here. Why don't you try next door?")
elif answer == " Cocktails" or answer == " cocktails" :
print ("Cocktails? who drinks those anymore?")
elif answer == " Liquor" or answer == " liquor":
print ("Sorry, we don't serve hard drinks here.")
else:
print ("You didn't pick a legitimate drink; try again!")
pub()
def beer_selection():
print ("Now we need to know what types of beers you're into. Select one of the \
following flavor profiles:")
flavor_profiles = ["Rich and malty", "Crisp and hoppy", "Light and fruity", "Smooth and balanced", "Piney and hoppy"]
任何帮助将不胜感激!
是不是真的整个脚本? – peterh 2015-04-04 05:15:11