i have a list like
lst = [[1,[2,[3,4,[7,8],5,6]]],[['a',['b',['c','d',['g','h'],'e','f']]]]]
i need to validate each time, if the current list item is a list or a single item(in this case a int/str)
If found a list again iterate that list, if found as a single element put it in a new list.
so at last i need 2 new list in particular order
new1 = [1,2,3,4,5,6,7,8]
new2 = ['a','b','c','d','e','f','g','h']
filtering is like outermost first then 2nd inner then 3rd inner...so on.
Can any body provide a code for it. Thanks in Advance.