Courseiva
StringsmediumMultiple SelectObjective-mapped

Immutable Types in Python — str, bytes, tuple

Which THREE of the following are immutable types in Python?

Quick Answer

The answer is tuple, along with str and bytes, as these three are immutable types in Python. Immutability means that once an object is created, its state cannot be changed; any operation that appears to modify it actually creates a new object in memory. For example, concatenating two strings produces a new string rather than altering the original, and the same holds for bytes and tuples. On the Certified Associate Python Programmer PCAP exam, this concept tests your understanding of Python’s core data model, often appearing in multiple-choice questions that ask you to distinguish immutable from mutable types. A common trap is confusing tuple with list or bytearray, both of which are mutable and can be modified in place. To remember, think of the acronym STB: Strings, Tuples, and Bytes are the immutable trio, while lists and bytearrays can change their contents freely.

⚠ Common exam trap

The PCAP exam often tests the distinction between bytes (immutable) and bytearray (mutable), expecting candidates to confuse the two because both deal with binary data.

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

str

(str) is correct because strings in Python are immutable sequences of Unicode code points. Once a string object is created, its contents cannot be changed; any operation that appears to modify a string (e.g., concatenation or slicing) actually creates a new string object in memory.

Answer analysis

Option-by-option breakdown

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

  • str

    Why this is correct

    Strings are immutable.

  • bytes

    Why this is correct

    Bytes objects are immutable.

  • bytearray

    Why it's wrong here

    Bytearrays are mutable.

  • list

    Why it's wrong here

    Lists are mutable.

  • tuple

    Why this is correct

    Tuples are immutable.

About these practice questions

One of 169 original PCAP practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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 PCAP

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 are immutable in Python?

easy
  • A.Set
  • B.Tuple
  • C.String
  • D.Dictionary
  • E.List

Why B: Tuple (B) is immutable because once created, its elements cannot be added, removed, or changed. This is enforced by Python's internal structure: tuples are stored as a fixed-length array of PyObject pointers, and any attempt to modify them raises a TypeError.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This PCAP 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 PCAP exam.