A common mistake is to pass a generator object to a function that expects an iterable.
While generators are iterable, they behave very differently from other iterables.
In particular, they are not reusable - you can iterate over them only once, unlike arrays or sets.
A common mistake is to pass a generator object to a function that expects an iterable. While generators are iterable, they behave very differently from other iterables. In particular, they are not reusable - you can iterate over them only once, unlike arrays or sets.