Oct-13-2023, 07:42 AM
__next__
is a special method. https://docs.python.org/3/library/stdtyp...r.__next__
https://docs.python.org/3/reference/expr...r.__next__
next()
is a built-in function, that calls __next__()
method of the first argument you supply. The docs:Quote:next(iterator)
next(iterator, default)
Retrieve the next item from the iterator by calling its__next__()
method. Ifdefault
is given, it is returned if the iterator is exhausted, otherwiseStopIteration
is raised.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs