What is the difference between iterators and iterables? #41
Answered
by
lukasmiller3
lukasmiller1
asked this question in
Q&A
-
|
What is the difference between iterators and iterables? |
Beta Was this translation helpful? Give feedback.
Answered by
lukasmiller3
Jan 22, 2026
Replies: 1 comment
-
|
A:Iterables are objects that can be iterated over (have iter method), while iterators are objects that implement iter and next methods. Iterators are iterables that maintain state and produce values one at a time. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
lukasmiller1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A:Iterables are objects that can be iterated over (have iter method), while iterators are objects that implement iter and next methods. Iterators are iterables that maintain state and produce values one at a time.