Courseiva

PCEP Computer Programming and Python Fundamentals Practice Question

Which TWO statements about Python lists are true?

⚠ Common exam trap

Python Institute often tests the misconception that lists are immutable or fixed-size, confusing them with tuples or arrays in other languages, and also tests the false assumption that all elements must be of the same type.

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

✓

Lists preserve the order of elements.

Option A is correct because Python lists are ordered sequences: elements are stored in a defined index order (starting at index 0), and iteration, indexing, and slicing return them in that insertion order. Option C is correct because lists are mutable: after creation you can change them in place with operations such as append(), insert(), remove(), pop(), sort(), or item assignment like lst[0] = 5. Option B is wrong because lists are dynamically sized; they grow and shrink automatically as elements are added or removed. Option D is wrong because immutability describes tuples (and strings), not lists, which support in-place modification. Option E is wrong because Python lists are heterogeneous and may hold objects of different types, e.g., [1, 'two', 3.0].

Answer analysis

Option-by-option breakdown

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

  • ✓

    Lists preserve the order of elements.

    Why this is correct

    Lists are ordered sequences, so elements retain their insertion position and can be retrieved by index, satisfying the stem's requirement for a true statement. This contrasts with unordered collections such as sets and dictionaries, where iteration order is not guaranteed by the data type itself.

  • ✗

    Lists have a fixed size once created.

    Why it's wrong here

    Lists are dynamically sized; append, extend, insert and pop change length at runtime, so no fixed capacity is imposed at creation. The temptation stems from languages such as Java or C, where arrays are allocated with a fixed length — that is the context in which this statement would be true.

  • ✓

    Lists can be modified after creation.

    Why this is correct

    Lists are mutable sequences, so elements can be reassigned, appended, or removed in place after creation, satisfying the stem's requirement for true statements. This contrasts with tuples and strings, which are immutable and raise errors on item assignment. Mutability is the defining property that makes lists suited to changing collections.

  • ✗

    Lists are immutable.

    Why it's wrong here

    Lists are mutable: append, remove and slice assignment all modify the object in place, so immutability contradicts the core list API. The tempting confusion arises because tuples and strings are immutable sequences; immutability would be the correct property to cite for a tuple, not a list.

  • ✗

    All elements in a list must be of the same type.

    Why it's wrong here

    Lists are heterogeneous containers; a single list may hold integers, strings and nested lists simultaneously, and Python enforces no element-type constraint. The temptation comes from array modules and NumPy arrays, where a declared dtype does require uniform element types — that is the scenario where this statement would hold.

About these practice questions

Courseiva writes every PCEP question from scratch — 482 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.