Featured Article

What Are Python Tuples?

Cynthia Jul 13, 2026

In Python, a tuple is an ordered collection of items separated by commas and enclosed in parentheses. It is similar to a list, but it's immutable, meaning you cannot change its content after it's created.

the differences between list and tuple in an appetizing game, which is also available
the differences between list and tuple in an appetizing game, which is also available

Tuples are often used to store multiple items of different types, such as a person's name and age, or a set of coordinates. They're also used as keys in dictionaries, as they are hashable, unlike lists.

Are Tuples Mutable In Python Explained With Examples
Are Tuples Mutable In Python Explained With Examples

Difference from Lists

Tuples and lists are both used to store multiple items, but they have some key differences. Lists are mutable, meaning you can change their content, while tuples are immutable. Lists are defined by square brackets, while tuples are defined by parentheses.

Python Collection Data Types | Lists, Tuples, Sets & Dictionaries Explained
Python Collection Data Types | Lists, Tuples, Sets & Dictionaries Explained

Lists are used when you need to change the data, while tuples are used when the data should not be changed. For instance, it is more fitting to store a person's information like name, age, and city in a tuple, as these details shouldn't vary.

Declaration

💜 List vs Tuple in Python 🐍 Confused between Lists and Tuples?
💜 List vs Tuple in Python 🐍 Confused between Lists and Tuples?

You can create a tuple by placing all the items (elements) inside parentheses (). The elements can be of different types, meaning you can store int, float, string, list, etc. in one tuple.

A tuple can be created without any values, in which case it only contains one element, the number 0. For example, T = (). To create a tuple with one element, you need to include a comma following the single element, e.g., T = (1,).

Operations

Tuples vs Lists
Tuples vs Lists

You can access tuple elements using indexing as in lists. The index can be an integer ranging from 0 to n-1, where n is the number of elements in the tuple. Negative indexes are also supported, counting from the end of the tuple.

You can concatenate or repeat tuples just like lists. However, you cannot modify the elements of a tuple as it is an immutable data structure. This means you can't add, remove, or change individual elements.

Features and Benefits

Tuples in Python; and how to create and access items form  it | Python Programming
Tuples in Python; and how to create and access items form it | Python Programming

Tuples have several features that make them a popular choice in certain scenarios. Besides being immutable, tuples are also ordered, meaning they have a specific sequence. Python retains this order of elements while creating tuples.

Tuples are more memory-friendly than lists. As tuples are immutable, Python assumes that its value won't change and allots less overhead, making it a more efficient choice for large data.

a screen shot of the text looping through tuples in python on a dark background
a screen shot of the text looping through tuples in python on a dark background
Coding For Beginners Python - Learn the Basics - Collections
Coding For Beginners Python - Learn the Basics - Collections
Python Tuple Sort | How to Sort Python Tuples? | Sorting Tuples ⋆ IpCisco
Python Tuple Sort | How to Sort Python Tuples? | Sorting Tuples ⋆ IpCisco
a diagram that shows the different types of python tuples and how to use them
a diagram that shows the different types of python tuples and how to use them
Python Tuples
Python Tuples
You learn Python by learning what you can do with data.🍀
You learn Python by learning what you can do with data.🍀
Python Cheat Sheet for Beginners
Python Cheat Sheet for Beginners
a poster with the words python master notes
a poster with the words python master notes
a poster with different types of text on it
a poster with different types of text on it

Use Cases

Tuples are often used to store multiple values in a single variable. They are great for FIXED data, such as elements of a struct, or for use as keys in dictionaries, where you need a reference type that can be hashed.

Tuples are also used as return values for multiple return values from functions where we're returning multiple values as a single tuple. This is a common use case in Python and makes your function return clean and well-structured data.

In conclusion, Python's tuple is a versatile tool that lets you store and manipulate multiple pieces of data efficiently. Being immutable, it's ideal when you want to ensure the data remains unaltered. Try incorporating tuples into your Python code to make it more efficient and readable.