maximum recursion depth exceeded in comparison python code example Example: increase limit of recusrion python import sys sys.setrecursionlimit(4000)