VOOZH about

URL: https://www.geeksforgeeks.org/python/are-tuples-immutable-in-python/

⇱ Are Tuples Immutable in Python? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Are Tuples Immutable in Python?

Last Updated : 23 Jul, 2025

Yes, tuples are immutable in Python. This means that once a tuple is created its elements cannot be changed, added or removed. The immutability of tuples makes them a fixed, unchangeable collection of items. This property distinguishes tuples from lists, which are mutable and allow for modifications after creation.

Example: Attempting to Modify a Tuple

Let’s see an example where we attempt to modify a tuple:


Output
Error: 'tuple' object does not support item assignment

As you can see, attempting to modify an element in a tuple results in a TypeError, which confirms that tuples are immutable.

Comment
Article Tags:
Article Tags: