Question #356

What is the output of the code snippet below?
x = [i for i in range(1, 10, 2)]

Generator expressions provide an additional shortcut to build generators out of expressions, similar to that of list comprehensions. In fact, a list comprehension can be turned into a generator expression by replacing the square brackets ([] ) with parentheses. Alternately, lists comprehensions cam be thought of generator expressions wrapped in a list constructor. (

Comment on Disqus:

Comment on Twitter:

Question difficulty: 🔵🔵🔵🔵🔵