我有一个 Python 版本 3.3.0,但我不知道为什么它不能让我在这里为 b 和 m 做很长时间...... 我试图在这里查找答案,但没有任何帮助...谢谢
我收到一个错误提示
NameError: global name 'long' is not defined
power = long(b) % long(m)
最佳答案
在 Python 3.x 中,使用 int
代替 long
。
来自 What’s New In Python 3.0, Integers :
- PEP 237: Essentially,
long
renamed toint
. That is, there is only one built-in integral type, namedint
; but it behaves mostly like the oldlong
type.
关于python-3.x - NameError:未定义全局名称 'long',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14904814/