Courseiva
Question 361 of 498
Functions, Tuples, Dictionaries and ExceptionsmediumMultiple ChoiceObjective-mapped

PCEP Tuple unpacking Practice Question

A function returns a tuple. Which code correctly unpacks the tuple?

def min_max(numbers):
    return min(numbers), max(numbers)

result = min_max([3, 1, 2])

⚠ Common exam trap

Candidates may think only one syntactic form is correct, but assignment target lists can be parenthesized or bare; both perform tuple unpacking.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

(a, b) = result

Both options B and C correctly unpack the tuple. Option B uses explicit parentheses, while option C uses the implicit form — both are valid tuple unpacking syntax in Python. Option A unpacks via indexing (not tuple unpacking), and option D incorrectly swaps the values.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • a = result[0]; b = result[1]

    Why it's wrong here

    Incorrect: This accesses elements by index, not tuple unpacking.

  • (a, b) = result

    Why this is correct

    Correct: Parenthesized target list unpacks the tuple into a and b.

  • a, b = result

    Why this is correct

    Correct: Bare target list unpacks the tuple — the most concise form.

  • a = result[1]; b = result[0]

    Why it's wrong here

    Incorrect: This accesses elements by index and swaps the order.

Visual reference

Client Server SYN (seq=100) SYN-ACK (seq=200, ack=101) ACK (ack=201) Connection established — data transfer begins

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jul 4, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This PCEP practice question is part of Courseiva's free Python Institute certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCEP exam.