以下是我遇到问题的代码部分:
AF_INET6
当我运行它时,会出现语法错误,突出显示def gbp():
gbpTo = int(input("Which currency are you converting into?"))
if gbpTo == "1":
print("You are converting Pounds Sterling to Pounds Sterling... there is no conversion needed!")
elif gpbTo == "2":
num = float(input("Please type in the amount of Pounds Sterling that you wish to convert into US Dollars")
calc = num * 1.55
calc = round(calc, 2)
print(num + " Pounds Sterling in US Dollars is $", calc)
。我该怎么办?
答案 0 :(得分:2)
缺少一个括号,即关闭float()的那个。
...
num = float(input("Please type in the amount of Pounds Sterling that you wish to convert into US Dollars"))
...