Courseiva
Control Flow, Loops, Lists and LogicmediumMultiple ChoiceObjective-mapped

PCEP Control Flow, Loops, Lists and Logic Practice Question

Which list method modifies the list in place by adding all elements of another iterable to the end?

⚠ Common exam trap

Python Institute often tests the distinction between `append()` and `extend()` — the trap is that candidates confuse adding an iterable as a single element (append) with adding its individual elements (extend), especially when the iterable is a list or string.

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

extend()

The `extend()` method modifies the list in place by appending all elements from the provided iterable (e.g., another list, tuple, or string) to the end. It does not return a new list; it mutates the original list directly, which is the behavior described in the question.

Answer analysis

Option-by-option breakdown

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

  • + operator

    Why it's wrong here

    Returns a new list, does not modify in place.

  • insert()

    Why it's wrong here

    Inserts at a specific index.

  • append()

    Why it's wrong here

    Adds a single element, not iterable contents.

  • extend()

    Why this is correct

    Expands the list with elements from an iterable.

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

Same concept, more angles

1 more way this is tested on PCEP

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. Which two of the following list methods modify the original list in place? (Choose two.)

easy
  • A.sort()
  • B.count()
  • C.sorted()
  • D.append()
  • E.copy()

Why A: A is correct because the `sort()` method sorts the list in place, meaning it modifies the original list object without creating a new one. D is correct because `append()` adds an element to the end of the list, directly mutating the original list.

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.