Roast topics
Find topics
Roast it!
Roast topics
Find topics
Find it!
Login
From:
learnbyexample
(Uncensored)
subscribe
Python tip 31: next() function
https://learnbyexample.github.io/tips/python-tip-31/
links
backlinks
The next() builtin function can be used on an iterator (but not iterables) to retrieve the next item. Once you have exhausted an iterator, trying to get another item will result in a StopIteration exception. Here's an example: