In Python, what is the difference between a generator expression and a list comprehension?
Anonymous
Example of list comprehension: [x*2 for x in range(10) if x%2] Example of generator expression: (x*2 for x in range(10) if x%2)
Check out your Company Bowl for anonymous work chats.