Re: [Tutor] removing sq. of items.

2012-05-23 Thread Mark Lawrence
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

Re: [Tutor] removing sq. of items.

2012-05-23 Thread Walter Prins
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

Re: [Tutor] removing sq. of items.

2012-05-23 Thread Dave Angel
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

Re: [Tutor] removing sq. of items.

2012-05-23 Thread Bala subramanian
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

Re: [Tutor] removing sq. of items.

2012-05-23 Thread Sarma Tangirala
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

[Tutor] removing sq. of items.

2012-05-23 Thread Bala subramanian
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