← Quiz: Scope and Closures: all 10 questions
Quiz: Scope and Closures · Question 10 of 10
What is the value of middle after a, middle, z = "python"?
What is the value of middle after a, *middle, z = "python"?
- A."ytho"
- B.('y', 't', 'h', 'o')
- C.['y', 't', 'h', 'o']
- D.An error
Answer & explanation
Correct answer: ['y', 't', 'h', 'o']
Extended unpacking always collects the leftover items into a list.
Can you get the rest right without peeking?
Take the timed Quiz: Scope and Closures quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →