| 1 | initial version |
The following
R = iter(range(9))
for r in R:
if r == 3:
a = next(R) # remove the next element from the iterator
print(r)
produces
0
1
2
3
5
6
7
8
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.