SpinTheMic
Pro

Explain it in 60 seconds

Iterables vs iterators

Data Engineering · Python · Intermediate

What is the difference between an iterable and an iterator?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • An iterable can be looped over, like a list or file.
  • An iterator produces the next value with next() and remembers its position.
  • iter() gets an iterator from an iterable.
  • Iterators are exhausted after one pass.
  • Generators are iterators.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics