Path: blob/master/Pythondaki Iteratorlar ve Generatorlar/Videolardaki Notebooklar/Iteratorlerin Oluşturulması ve Kullanılması.ipynb
765 views
Kernel: Python 3
In [9]:
In [10]:
Out[10]:
['__add__',
'__class__',
'__contains__',
'__delattr__',
'__delitem__',
'__dir__',
'__doc__',
'__eq__',
'__format__',
'__ge__',
'__getattribute__',
'__getitem__',
'__gt__',
'__hash__',
'__iadd__',
'__imul__',
'__init__',
'__init_subclass__',
'__iter__',
'__le__',
'__len__',
'__lt__',
'__mul__',
'__ne__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__reversed__',
'__rmul__',
'__setattr__',
'__setitem__',
'__sizeof__',
'__str__',
'__subclasshook__',
'append',
'clear',
'copy',
'count',
'extend',
'index',
'insert',
'pop',
'remove',
'reverse',
'sort']
In [11]:
In [12]:
Out[12]:
<list_iterator object at 0x000000792684FA90>
In [13]:
Out[13]:
1
In [14]:
Out[14]:
2
In [15]:
Out[15]:
3
In [16]:
Out[16]:
4
In [17]:
Out[17]:
5
In [18]:
Out[18]:
---------------------------------------------------------------------------
StopIteration Traceback (most recent call last)
<ipython-input-18-3733e97f93d6> in <module>()
----> 1 next(iterator)
StopIteration:
In [27]:
Out[27]:
1
2
3
4
5
In [28]:
Out[28]:
1
2
3
4
5
In [48]:
In [49]:
In [50]:
In [51]:
Out[51]:
'Atv'
In [52]:
Out[52]:
'Trt'
In [53]:
Out[53]:
'Fox'
In [54]:
Out[54]:
'Kanal D'
In [55]:
Out[55]:
'Bloomberg'
In [56]:
Out[56]:
---------------------------------------------------------------------------
StopIteration Traceback (most recent call last)
<ipython-input-56-3733e97f93d6> in <module>()
----> 1 next(iterator)
<ipython-input-48-e4c21cf75a4c> in __next__(self)
11 else:
12 self.index = -1
---> 13 raise StopIteration
14
15
StopIteration:
In [57]:
Out[57]:
Atv
Trt
Fox
Kanal D
Bloomberg
In [ ]: