hey
I want to be capable of converting a string into a list where all the items, in
the list, have a fixed length not equal to 1 e.g i have k = 'abcdefgh' and I
want the fixed length for all the the items to be 2 then the list would look
like ['ab', 'cd', 'ef, 'gh']. How do i do this?
- Emi
Emil wrote:
> hey
>
> I want to be capable of converting a string into a list where all the items,
> in the list, have a fixed length not equal to 1 e.g i have k = 'abcdefgh'
> and I want the fixed length for all the the items to be 2 then the list would
> look like ['ab', 'cd', 'ef, 'gh']. Ho
Emil wrote:
> hey
>
> I want to be capable of converting a string into a list where all the items,
> in the list, have a fixed length not equal to 1 e.g i have k = 'abcdefgh'
> and I want the fixed length for all the the items to be 2 then the list would
> look like ['ab', 'cd', 'ef, 'gh']. Ho
Ricardo Aráoz wrote:
> Emil wrote:
>> hey
>>
>> I want to be capable of converting a string into a list where all the items,
>> in the list, have a fixed length not equal to 1 e.g i have k = 'abcdefgh'
>> and I want the fixed length for all the the items to be 2 then the list
>> would look like
"Emil" <[EMAIL PROTECTED]> wrote
> I want to be capable of converting a string into a list where all
> the items,
> in the list, have a fixed length not equal to 1
You can use list slicing to do this.
Combine with the stepsize parameter of the range function
> k = 'abcdefgh' and I want the f
Martin Walsh wrote:
> Ricardo Aráoz wrote:
>> Emil wrote:
>>> hey
>>>
>>> I want to be capable of converting a string into a list where all the
>>> items, in the list, have a fixed length not equal to 1 e.g i have k =
>>> 'abcdefgh' and I want the fixed length for all the the items to be 2 then