Advanced Topics in Python
We are gonna discuss some advanced topics beyond common usage in string, list, tree in python. See what we've got here..
class myIterator:
    def __init__(self):
        pass
    def __iter__(self):
        return self
    def __next__(self):
The protocol to create an Iterator contains two main parts: __iter__ and __next__. The __iter__ returns the object we want to iterate over and the __next__ mehtod is automatically on eahc iteration and that returns the value for the current iteration. Notice: Python 2 use next and Python 3 use __next__()
 
         
         
         
        