I am running the exact same code on both windows and mac, with python 3.5 64 bit. On windows, it looks like this: However, this code works fine on my mac. Could anyone help explain why or give a solution for the code on windows? Thanks so much! Answer You’ll get that error once your numbers are greater than sys.maxsize: