Looking at the next element in a for loop

- madsurfer2000 at hotmail.com
Sun May 2 06:38:57 EDT 2004


Hi,

If I have a simple for loop like this:

for a in b:
   print a

Is there a way I can get the next element in the loop? Something like this:

for a in b:
   if a == 1:
      print <next a>



More information about the Python-list mailing list