Question 1
Back to Exercise
What does [x * 2 for x in (1, 2, 3)] produce?
- A The tuple (2, 4, 6)
- B A generator
- C The list [1, 2, 3, 1, 2, 3]
- D The list [2, 4, 6] Correct
Correct Answer: Option D
Square brackets always build a list, whatever the input iterable is.
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!