I am trying to create a new embeded list from two lists(a and b) as below:
list_a = ['abc','def','opq']
list_b = [1,2]
resulting_list =
[['abc',1,2],
['def',1,2],
['opq',1,2]]
I have tried below below function with list comprehension, but it doesn't return expected result.
def combine_list(list_a, list_b):
return [[post].extend(list_b) for post in list_a]
I expected to return:
[['abc',1,2],
['def',1,2],
['opq',1,2]]
instead, I got
[None, None, None]
Why doesn't the list comprehension work?