我刚刚开始学习python,现在我正试图了解Math库。我做了一个非常简单的测试(只有3行代码):
Import Math
number = math.ceil(2.8)
print(number)
通过运行此代码,我得到了错误:
AttributeError: partially initialized module 'math' has no attribute 'ceil' (most likely due to a circular import)
有人可以帮助我理解这种错误吗?
您import math
不应大写。
因为Python区分大小写
您执行此Import Math
尝试一下
import math
number = math.ceil(2.8)
print(number)