Q:

How to combine 2 list into pairs of nested list?

So, I have 2 lists:
list1 = [1,2,3,4,5]
list2= [6,7,8,9,10]

The desired output:
newlist = [[1,6],[2,7],[3,8],[4,9],[5,10]]

How to do that in Python?

A:

Use zip, but output is list of tuples, so added map by list:
a = list(map(list, zip(list1, list2)))
print (a)
[[1, 6], [2, 7], [3, 8], [4, 9], [5, 10]]

Or use list comprehension:
a = [list(x) for x in zip(list1, list2)]

