0

I was trying to come up with something in one line which could zip a list of list in one line.

arr=[[1,2,3],[4,5,6],[7,8,9]]
reduce(zip,arr,[])

The output I would want would be similar to : zip([1,2,3],[4,5,6],[7,8,9]) which is [(1, 4, 7), (2, 5, 8), (3, 6, 9)]

Any help would be appreciated.

Akshay Hazari
  • 3,186
  • 4
  • 48
  • 84

0 Answers0