In Python, which of the following built-in data types is immutable?

Answer and explanation

Correct answer: D. Tuple

  1. Step 1: Differentiate mutable and immutable object types in Python.
  2. Step 2: Tuples, integers, floats, strings, and frozensets cannot be modified in place after instantiation; they are strictly immutable. Lists, dictionaries, and sets are mutable.
Answer
Tuple.
Why not the others: Lists allow item reassignment (`lst[0] = 5`); dictionaries allow key-value modifications; sets support `.add()` and `.remove()`.

Practise more Algorithms and Python Programming.

Free questions with an explanation for every one, and full timed EmSAT Achieve (UAE) mock tests.