← Previous Next →

Flatten lists

Created by Julien Palard

Instructions

Write a flatten function, which given a list of lists (of any depth) returns a flattened version of it.

Example

>>> flatten([[1], 2, [[3, 4], 5], [[[]]], [[[6]]], 7, 8, []])

should return [1, 2, 3, 4, 5, 6, 7, 8].

Your Code

Login to check your code and save your progress.