generating list of sub lists

cesco fd.calabrese at gmail.com
Sun Sep 16 10:26:57 CEST 2007


Hi,

is there a one-liner to accomplish the following task?
>From the list
l = ['string1', 'string2', 'string3']
generate the list of lists
l = [['string1'], ['string1', 'string2'], ['string1', 'string2',
'string3']]

Any help would be appreciated.

Thanks
Francesco




More information about the Python-list mailing list