an enumerate question
eight02645999 at yahoo.com
eight02645999 at yahoo.com
Mon Mar 19 22:01:15 EDT 2007
On Mar 20, 9:48 am, Paul Rubin <http://phr...@NOSPAM.invalid> wrote:
> eight02645... at yahoo.com writes:
> > hi
> > say i want to enumerate lines of a file
> > eg
> > for n,l in enumerate(open("file")):
> > # print next line ie
>
> > is there a way to print out the next line from current line using the
> > above?.
>
> I don't understand what you're trying to do. You mean you're
> trying to print all lines except the first one?
thanks for replying. sorry i make clear again.
say
for n,l in enumerate(open("file")):
print n,l # this prints current line
print next line in this current iteration of the loop.
hope you can understand now.
thanks.
More information about the Python-list
mailing list