I found a solution for my problem here.
The thing is, my answer was exactly the same, except for (checkio(x))
, I had just (x)
.
So instead of this (working solution):
def checkio(data):
new_list = []
for x in data:
if type(x) == list:
new_list.extend(checkio(x))
else:
new_list.append(x)
return new_list
I had:
def checkio(data):
new_list = []
for x in data:
if type(x) == list:
new_list.extend(x)
else:
new_list.append(x)
return new_list
Why doesn't that work?
Why do I need to reference the function itself?
What is checkio(x)
exactly?