On Mon, 17 Sep 2007 20:52:14 +1000, Ross Wilson wrote:
> cesco wrote:
>> 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',
>> 'st
cesco wrote:
> 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
> Fran
Rustom Mody wrote:
> On 9/16/07, cesco <[EMAIL PROTECTED]> wrote:
>> 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',
>> 'stri
On 9/16/07, cesco <[EMAIL PROTECTED]> wrote:
> 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
cesco wrote:
> l = ['string1', 'string2', 'string3']
l2=[l[:i+1] for i in range(len(l))]
--
http://mail.python.org/mailman/listinfo/python-list
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
--
http://mail.python.org/mail