Course
Simulator
More
Premium
Log in
Python Function Reference
Functions
next
next
Retrieve the next item from the iterator by calling its __next__() method.
Python 3.13
next
(
iterator
,
default
=
None
)
iterator
The iterator.
default
Default value on StopIteration.
Examples
Python 3.13
>>
>
it
=
iter
(
[
1
]
)
>>
>
next
(
it
)
1