Question 6
Back to Exercise
What is (x * x for x in range(5))?
- A A generator expression Correct
- B A tuple of squares
- C A list of squares
- D A SyntaxError
Correct Answer: Option A
There is no tuple comprehension; tuple(x * x for x in range(5)) builds a tuple.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!