It is a normal situation.
If you see something like
I deleted it.
Then it means that your code exceeds the recursion limit.
How to solve:
from sys import setrecursionlimit as R
R(10000)
At the start of your code, set the recursion limit
from random import shuffle as r
from sys import setrecursionlimit as R
global L
L=100
def merge(l1,l2):
global L
R(L)
L += 1
if not (len(l1) and len(l2)):
return l1+l2
else:
if l1[0]<l2[0]:
return [l1[0]]+merge(l1[1:],l2[:])
else:
return [l2[0]]+merge(l1[:],l2[1:])
def sort(l):
global L
R(L)
L+=1
if len(l)<2:
return l
else:
return merge(sort(l[:len(l)//2]),sort(l[len(l)//2:]))
_=list(range(1,1111))
r(_)
print(_)
print(sort(_))
Every time the recursion starts we add the recursion limit.
If you didn’t see any warning, it means that the recursion takes too long.
Which leads to...