After a, *b = [1, 2, 3], what is the value of b?
Correct answer
B. [2, 3]
16 views
B. [2, 3]
16 views
Extended unpacking gives a the first item and collects the rest into a list. It also works in the middle, as in first, *mid, last = seq.
Asked in: NTS, Python Developer Interviews
Not sure why the answer is B? Ask here and get an explanation.