Question: I am a python newbie.

I have a list of lists:

```
test=[[1,2,3],[4,5,6],[7,8,9],[10,11,12]]

```

I want to combine the elements of each list so that I get as a result:

```
result = [[1,4,7,10],[2,5,8,11],[3,6,9,12]]

```

I am looking for a solution that will work for n elements and where the answer is a list of lists (a list of tuples will not work for me). Ideally, I would like test to have n elements instead of a definite number.

I wish that the following would work:

```
result = map(zip,test)

```

But it does not.

Is there a straight forward way to do this?

Answer: 
```
result = map(list, zip(*test))

```
You are not looking for [`map()`](https://docs.python.org/2/library/functions.html#map).

You are looking for [`zip()`](https://docs.python.org/2/library/functions.html#zip) with unpacking, this function does exactly what you want:

```
result = zip(*test)
# [(1, 4, 7, 10), (2, 5, 8, 11), (3, 6, 9, 12)]

```

If you really need a list of lists, there you can use `map()`:

```
result = map(list, zip(*test))
# [[1, 4, 7, 10], [2, 5, 8, 11], [3, 6, 9, 12]]

```

Note that if you are using Python 3, `zip()` and `map()` no longer return a `list`, so you may need to wrap the whole expression with a `list()` cast.