I have the following code:

f = open('file.txt',r)
for line in f.read():
     if line == "3":
           line.next
           print line
f.close()

The file.txt looks like
1
2
3
4
5

I would like the code to output "4"

but I don't know how to use the next.  Are there any other way?

Thanks
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to