错误:
Traceback (most recent call last):
File "C:/Python/CurrencyCoverter/currencyconverter.py", line 16, in <module>
if userChoice == "1":
NameError: name 'userChoice' is not defined
如果我尝试运行我的货币转换器脚本,这里是脚本(当前未完成):
def currencyConvert():
userChoice = input("What do you want to convert? \n1.)USD > UK \n2.)USD > UK \n")
if userChoice == "1":
userUSD = imput("ENTERAMOUNT")
UK = userUSD * 0.62
print ("USD", userUSD, "= ", UK, "UK")
elif userChoice == "2":
print ("Choice = 2")
else:
print ("Error, Please Choose Either Option 1 or 2")