Advanced Python Programming
What are the method(s) that iterator object must implement?
__iter__() and __next__()
If a function contains at least one yield statement, it becomes a generator function.
In Python, there is a built-in function property() that returns a property object. The property object has which of the following methods?
getter(), setter() and delete()
zip
produces an iterator which can only be iterated once. Once you have iterated it, it’s exhausted.Where to use closure
- We must have a nested function (function inside a function).
- The nested function must refer to a value defined in the enclosing function.
- The enclosing function must return the nested function.
Advanced Python Programming