GH avatar Bite 84. Flatten lists recursively (Droste Bite)

Complete flatten that takes a list of lists (which can have lists ad infinitum) and flatten them into a one dimensional list.

So this input:

[1, [2, 3], [4, 5, [6, 7, [8, 9, 10]]]]
... should generate this output:
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

Make sure you support both lists and tuples. You probably want to use recursion here ... have fun!

go back Intermediate level
Bitecoin 3X

75 out of 75 users completed this Bite.
Will you be Pythonista #76 to crack this Bite?
Resolution time: ~39 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 4.75 on a 1-10 difficulty scale.
» Up for a challenge? 💪

Buy Now Login and get coding
We use Python 3.7