Python Programming - Generators - Discussion
Discussion Forum : Generators - General Questions (Q.No. 10)
10.
What is the main difference between a generator and a list comprehension?
Answer: Option
Explanation:
List comprehensions create lists in memory, whereas generators produce values on-the-fly and do not store the entire sequence in memory. Generators are more memory-efficient.
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers