[Tutor] How to skip to next line in for loop

bob gailer bgailer at gmail.com
Fri May 2 20:49:02 CEST 2008


bob gailer wrote:
> Or even simplre
>
> f = open('file.txt',r).readlines()
> print [f[x+1] for x, line in enumerate(f) if line.rstrip() == "3"][0]
>


-- 
Bob Gailer
919-636-4239 Chapel Hill, NC



More information about the Tutor mailing list