[Tutor] removing sq. of items.
wprins at gmail.com
Wed May 23 13:31:46 CEST 2012
On 23 May 2012 11:07, Bala subramanian <bala.biophysics at gmail.com> wrote:
> 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 think what you're
trying to achieve.:
for i in range(0, len(myl),15):
for x in new: print x
Ultimately the new list contains the same elements as the old list so
by itself isn't very useful except to show that the split/slice and
merge operations don't lose items/data from the original list.
More information about the Tutor