List slicing

Mark McEahern marklists at mceahern.com
Mon Oct 7 12:24:54 EDT 2002


> is there a slicing operation on nested lists ?
> i.e.
>  list=[[1,2,3],[1,2,3],[1,2,3]]

1.  Don't use list as a variable name.
2.  Try:

    my_list = [[1,2,3],[1,2,3],[1,2,3]]
    x = zip(*my_list)

// m




More information about the Python-list mailing list