Explore Library
FlashcardAdvanced

Comprehensions vs Generator Expressions

Learn how comprehensions build collections eagerly while generator expressions produce values lazily.

Question

What is the difference between [x*x for x in nums] and (x*x for x in nums)?

Click to reveal answer