NameError: global name 'long' is not defined NameError: global name 'long' is not defined python-3.x python-3.x

NameError: global name 'long' is not defined


In Python 3.x, use int instead of long.

From What’s New In Python 3.0, Integers:

  • PEP 237: Essentially, long renamed to int. That is, there is only one built-in integral type, named int; but it behaves mostly like the old long type.