Question 9
Back to Exercise
What is the output of the following Python program?
a, *b = (1,)
*c, d = (7, 8, 9)
print(a, b, c, d)
- A 1 () (7, 8) 9
- B 1 [] [7, 8] 9 Correct
- C 1 None [7, 8] 9
- D ValueError
Correct Answer: Option B
A starred target gets a list, empty if nothing is left. It may stand at the start, middle or end.
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!