Interview Q&A / Python
Python interview questions
Lists, dictionaries, generators, decorators and the Python questions asked in service-company and data roles.
Prefer rapid revision? Practise Python short interview answers →
- What is the difference between an iterable and an iterator in Python?
An iterable can produce an iterator when you call iter() on it, such as a list or string. An iterator is the object that actually hands out items one at a time through next() and remembers its position. Iterators are single-use.
BeginnerQuick answer1 min read