kernel died while flattening lists

PHOTO EMBED

Wed Jun 01 2022 14:56:23 GMT+0000 (UTC)

Saved by @redpsych #undefined

# Dead after running

list_ = [0, [2, 3, [5, 4], 6, 5], [3, 4, 5], 6, 7, 9]

def flattening(list_):
    list1 = []
    for item in list_:
        if type(item)!= list:
            list1.append(item)
        else: # type(item)!= list:
            list1.extend(item)
            return flattening(list_); 
    print(list1)

flattening(list_)
    
content_copyCOPY