1. Home
  2. Data Science
  3. Python
  4. Why are Python strings immutable?

Added 25 Nov 2026

Why are Python strings immutable?

  1. To save disk space
  2. Because of the GIL
  3. Operations return new strings, making them hashable and safe to share Correct answer
  4. To prevent slicing

Correct answer

C. Operations return new strings, making them hashable and safe to share

6 views

MCQSEXAM

Explanation

Immutability allows strings to be dictionary keys and enables interning.

Reference

Asked in: Python Interview Strings

https://docs.python.org/3/library/stdtypes.html#string-methods

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs