Hi I am troubling with this problem and I want to flatten a nested list. Here is my code but it does not work can someone help me please
def paps(lst):
if lst == []:
return lst
if type(lst[0]) == list:
return paps(lst[0])+ paps(lst[1:])
else:
return lst[:1] + paps(lst[1:])
My problem must be with recursion.