Flatten lists

Created by Julien Palard

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, []])
[1, 2, 3, 4, 5, 6, 7, 8]

There's no corrections yet, hit the `Submit` button to send your code to the correction bot.

Keyboard shortcuts:

  • Ctrl-Enter: Send your code to the correction bot.
  • Escape: Get back to the instructions tab.

See solutions