1. Home
  2. Data Science
  3. Python
  4. After a, *b = [1, 2, 3], what is the value of b?

Added 2 Nov 2026

After a, *b = [1, 2, 3], what is the value of b?

  1. [1, 2, 3]
  2. [2, 3] Correct answer
  3. 2
  4. (2, 3)

Correct answer

B. [2, 3]

16 views

MCQSEXAM

Explanation

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.

Reference

Asked in: NTS, Python Developer Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs