NameError: global name 'long' is not defined

Python 3.xLong IntegerNameerror

Python 3.x Problem Overview


I have a Python version 3.3.0 and I am not sure why it does not let me do long for b and m here... I tried to look up the answers on here and but nothing helped...thanks

im getting an error saying

NameError: global name 'long' is not defined


power = long(b) % long(m)

Python 3.x Solutions


Solution 1 - Python 3.x

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionManualView Question on Stackoverflow
Solution 1 - Python 3.xJon-EricView Answer on Stackoverflow