Question: what is the difference between an iterator generator and list comprehension in python?
Answer: So what's the difference between Generator Expressions and List Comprehensions? The generator yields one item at a time and generates item only when in demand. Whereas, in a list comprehension, Python reserves memory for the whole list.