# system slowed list_ = [0, [2, 3, [5, 4], 6, 5], [3, 4, 5], 6, 7, 9] list1 = [] for item in list_: if type(item)== list: while type(item)== list: list1.extend(item) else: list1.append(item) # if type(item)== list: # list1.extend(item) # elif type(item)!= list: print(list1)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter