I'm a new Python learner and I have an assignment to extract all elements from a simple list (any depth) and unpack it into a new list of simple elements.
Something like this:
lst = [1, 2, [3, 4, [5, 6, 7]]]
new_lst = [1, 2, 3, 4, 5, 6, 7]
I can't use functions to do it directly.. can only use loops (for/while) or conditional statements (if elif else) or python functions like "append".
Any ideas?