python 2.7 - zipping a list of lists according to index? -


How can I use zip to zip a list of lists by index? ?

i i i (a, b, c) print zip (k) in print zip [a, b, c] >

zip (a, b, c) print [('f', 'h', 's'), ('o', 'e', ​​'t' ), This is what I need to do ('u', 'l', 'a'), ('r', 'p', 'k')]

however zip (k) print [(['f', 'o', 'u', 'r'],), (['h' , 'E', 'L', 'P'],), (['s,' t ',' a ',' k '],)]

does not do.

Is there a list int " brake up " Is this a separate piece for zip function?

I need a list, this is a simple example, for unknown quantities in Kashmir, where I am using it.

Try the following code:

zip (* [lists. .])

You can put any number of lists in there (can easily be generated using list comprehension)


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -