You will receive a list with sublists and must return all subslists in a unique flat list.
Example:
input_list = [[1,2,3], [4,5,6], [7,8,9]]
output_list = [1,2,3,4,5,6,7,8,9]
def flat_the_list(item_list):
return [subitem for item in item_list for subitem in item]
import codewars_test as test
from solution import flat_the_list
@test.describe("flat_list")
def test_group():
@test.it("basic test case")
def basic_test_case():
test.assert_equals(flat_the_list([[1,2,3], [4,5,6], [7,8,9]]), [1,2,3,4,5,6,7,8,9])
test.assert_equals(flat_the_list([[0], [1,2,3], [4,5,6,7], [8,9]]), [0,1,2,3,4,5,6,7,8,9])
test.assert_equals(flat_the_list([[], [], []]), [])