Skip to content

Commit c28dd16

Browse files
committed
commit
1 parent e11a163 commit c28dd16

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

generatorTest.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
def gen():
2+
x, y = 1, 2
3+
while True:
4+
yield x, y
5+
x += 1
6+
# yield x, y
7+
8+
it = gen()
9+
10+
print it.next()
11+
print it.next()
12+
print it.next()
13+
14+
try:
15+
print it.next()
16+
except StopIteration:
17+
print "Iteration finished"
18+
19+

0 commit comments

Comments
 (0)