我编写的货币转换程序继续出现此错误
baht = raw_input("enter baht")
usd = int(baht) / (30.94)
print "%r baht equals %r usd" % (baht, usd)
最佳答案
问题:
- 使用 float(baht) 作为 Bath,它可能是利率,而不是整数。
- 不要使用逗号 (,) 作为小数点分隔符,而是使用点 (.)
关于python - 以 10 为基数的 int() 的文字无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10096450/