通过乘以另一个来创建一个新变量

时间:2015-07-05 20:06:32

标签: multiplying

以下是我遇到问题的代码部分:

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) 。我该怎么办?

1 个答案:

答案 0 :(得分:2)

缺少一个括号,即关闭float()的那个。

...
num = float(input("Please type in the amount of Pounds Sterling that you wish to convert into US Dollars"))
...