I have written the following code to return True if the list has any repeating elements and False ow
def has_repeats(L,newlist = None):
if newlist == None:
newlist = []
if len(L) == 0:
return False
if L[0] in newlist:
return True
else:
newlist.append(L[0])
has_repeats(L[1:],newlist)
It is not returning True or False for anything and I have no idea why, please help!