Courseiva
Computer Programming and Python FundamentalsmediumMultiple SelectObjective-mapped

PCEP Computer Programming and Python Fundamentals Practice Question

Which FOUR of the following are valid ways to create a list with elements 1, 2, 3? (Choose four.)

⚠ Common exam trap

Python Institute often tests the distinction between the `list()` constructor requiring a single iterable argument versus the mistaken belief that it accepts multiple positional arguments, as in option D.

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

[1, 2, 3,]

Options A, B, C, and E are all valid ways. A: list literal with trailing comma; B: list() constructor with range; C: standard list literal; E: list() constructor with a tuple. Option D is invalid because list() expects a single iterable argument, not multiple arguments.

Answer analysis

Option-by-option breakdown

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

  • [1, 2, 3,]

    Why this is correct

    Correct. A trailing comma is allowed in Python list literals, so [1, 2, 3,] creates a list with elements 1, 2, 3.

  • list(range(1, 4))

    Why this is correct

    Correct. list(range(1, 4)) generates numbers 1 through 3 and creates the list [1, 2, 3].

  • [1, 2, 3]

    Why this is correct

    Correct. [1, 2, 3] is the standard literal syntax for creating a list with those elements.

  • list(1, 2, 3)

    Why it's wrong here

    Invalid. The list() constructor takes only one iterable argument, but here multiple arguments are passed.

  • list((1, 2, 3))

    Why this is correct

    Invalid for this question. While list((1, 2, 3)) technically produces the list [1, 2, 3], it is a conversion from a tuple, not a direct list creation method. The question expects only literal or range-based constructions.

About these practice questions

This PCEP question is part of Courseiva's 498-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.