Alright, so I have two lists that look like this
listx = [2, 4, 5, 9, 11]
listy = [3, 5, 9, 12, 14]
Right now, when I do zip, I get this
listz = zip(listx, listy)
listz = [(2,3), (4,5), (5,9), (9, 12), (11,14)]
Is there any way to make this a list of lists instead of an array, like so
listz = [[2,3], [4,5], [5,9], [9,12], [11,14]]
Thanks!
You can use a comprehension:
or generator expression: