get even iterable example
This commit is contained in:
parent
b7f1d07142
commit
a621f44d78
10
python-temel/geteven.iterable.py
Normal file
10
python-temel/geteven.iterable.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
def geteven(iterable):
|
||||||
|
for x in iterable:
|
||||||
|
if x % 2 == 0:
|
||||||
|
yield x
|
||||||
|
|
||||||
|
l = [2, 5, 7, 8, 4]
|
||||||
|
for i in geteven(l):
|
||||||
|
print(i, end=' ')
|
||||||
|
print()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user