iterable

Any object you can loop over with for, such as a list, string, tuple, dictionary, set, range, file or generator.

In more detail

Iteration is an agreement, not a type: an iterable is anything that can hand out an iterator when asked with iter(). Functions such as sum, sorted, list and join accept any iterable.

Related terms

Taught in

References

Certification courses