NameError: global name 'long' is not defined
Solution 1:
In Python 3.x, use int
instead of long
.
From 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.