Appending to a list of lists sequentially

Viewed 76

I have two list of lists:

my_list = [[1,2,3,4], [5,6,7,8]]
my_list2 = [['a', 'b', 'c'], ['d', 'e', 'f']]

I want my output to look like this:

my_list = [[1,2,3,4,'a','b','c'], [5,6,7,8,'d','e','f']]

I wrote the following code to do this but I end up getting more lists in my result.

my_list = map(list, (zip(my_list, my_list2)))

this produces the result as:

[[[1, 2, 3, 4], ['a', 'b', 'c']], [[5, 6, 7, 8], ['d', 'e', 'f']]]

Is there a way that I can remove the redundant lists. Thanks

3 Answers
Related