On 23/05/2012 12:27, Dave Angel wrote:
On 05/23/2012 06:07 AM, Bala subramanian wrote:
Hi,
I infact want write each of the item in the sliced list to a file.
This line is top-posted. Please put your remarks *after* the part
I agree entirely but top posting is getting worse and worse on all
On 23 May 2012 11:07, Bala subramanian wrote:
> Hi,
> I infact want write each of the item in the sliced list to a file.
You don't have any actual files in your program so I'm assuming by
file you mean "each item is printed to standard output"?
Anyway, you might try the following which is I thin
On 05/23/2012 06:07 AM, Bala subramanian wrote:
> Hi,
> I infact want write each of the item in the sliced list to a file.
This line is top-posted. Please put your remarks *after* the part
you've quoted.
There isn't one slice, but many of them. So you have a list of lists.
>
> On Wed, May 23, 20
Hi,
I infact want write each of the item in the sliced list to a file.
On Wed, May 23, 2012 at 11:59 AM, Sarma Tangirala wrote:
>
>
> On 23 May 2012 15:21, Bala subramanian wrote:
>
>> Friends,
>> While iterating through each list item and printing/writing it, why does
>> the sq. brackets get p
On 23 May 2012 15:21, Bala subramanian wrote:
> Friends,
> While iterating through each list item and printing/writing it, why does
> the sq. brackets get printed/written to the file. Just a small eg.code is
> given below.
>
> >>>N=100
> >>> myl=range(1,100+1)
> >>> new=[myl[i:i+15] for i in rang
Friends,
While iterating through each list item and printing/writing it, why does
the sq. brackets get printed/written to the file. Just a small eg.code is
given below.
>>>N=100
>>> myl=range(1,100+1)
>>> new=[myl[i:i+15] for i in range(0, len(myl),15)]
>>> for x in new: print x
Thanks,
Bala