yield akış
This commit is contained in:
parent
a51ea42073
commit
5d1f116933
15
python-temel/yield.akis.py
Normal file
15
python-temel/yield.akis.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
def foo():
|
||||
print('one')
|
||||
yield
|
||||
print('two')
|
||||
yield
|
||||
print('three')
|
||||
|
||||
try:
|
||||
g = foo()
|
||||
iterator = iter(g)
|
||||
next(iterator)
|
||||
next(iterator)
|
||||
next(iterator)
|
||||
except:
|
||||
pass
|
Loading…
Reference in New Issue
Block a user