关于decimal模块使用
import decimala = decimal.Decimal('0.1')
b = decimal.Decimal('0.2')
print (a + b)
SyntaxError: multiple statements found while compiling a single statement
萌新不是很懂为什么这个问题会产生,是decimal模块引入有问题吗? 错误的原因是在交互模式,通过粘贴输入多行语句。解决方法:
1.新建一个程序,在程序中输入。
2.交互模式,一次一行的输入或粘贴。
页:
[1]