CBSE Class 12 Computer Science Question 69 of 105

Python Revision Tour — Question 23

Back to all questions
23
Question

Question 22

An immutable data type is one that cannot change after being created. Give three reasons to use immutable data.

Answer

Three reasons to use immutable data types are:

  1. Immutable data types increase the efficiency of the program as they are quicker to access than mutable data types.
  2. Immutable data types helps in efficient use of memory storage as different variables containing the same value can point to the same memory location. Immutability guarantees that contents of the memory location will not change.
  3. Immutable data types are thread-safe so they make it easier to parallelize the program through multi-threading.