I have this bit of code, which I copied from my book;
But I am currently using Python 3.1, does anyone knows what long is in Python3? Because I am getting an error saying long is not defined, and when I try in Python 2 it works
Code:
def checkIndex(key): if not isinstance(key,(int, long)): raise TypeError if key < 0: raise IndexError
Comment