Define Tuple in Python with Example: Simple Guide

Logan Jul 13, 2026

A tuple is a collection of items, which are ordered and immutable in Python. Unlike lists, tuples once created cannot be altered - a feature that can be useful in many situations due to the inherent security and reliability it provides.

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

To understand tuples, let's first appreciate their syntax. A tuple can be created by placing all the items, separated by commas, enclosed in parentheses. If you have a single item, make sure to include a trailing comma to differentiate it from a miss ing parentheses.

Tuples in Python - UnicMinds
Tuples in Python - UnicMinds

Defining a Tuple in Python

To define a tuple, follow the syntax: (item1, item2, ...). If there's just one item, use: (item,). Here's an example:

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

my_tuple = (1, 2, 3)

Different Data Types in a Tuple

Python Tuples
Python Tuples

Tuples can hold data of varying types - integer, float, string, list, and other tuples, too. Here's an example:

my_variable_tuple = (1, 2.0, "Hi", [1, 2, 3], (4, 5))

Tuple with Non-Unique Elements

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

Also, tuples can contain duplicate elements. If you want to create a tuple with the same element repeated, you can do so as:

repeat_tuple = ("Hello",) * 4

Operations on Tuples

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

Tuples support various operations that can be very useful in different scenarios. Let's look at some of them:

Accessing Tuple Elements

Tuple in Python (with Examples) - Scientech Easy
Tuple in Python (with Examples) - Scientech Easy
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
TUPLES vs LISTS
TUPLES vs LISTS
Coding For Beginners Python - Learn the Basics - Collections
Coding For Beginners Python - Learn the Basics - Collections
Python Tuples vs Sets Explained (Beginner Guide)
Python Tuples vs Sets Explained (Beginner Guide)
All Important Python Functions for Beginners (Complete Cheat Sheet)
All Important Python Functions for Beginners (Complete Cheat Sheet)
Python Tuples Explained for Beginners (Day 16)
Python Tuples Explained for Beginners (Day 16)
Python If...Elif...Else Statement - PythonForBeginners.com
Python If...Elif...Else Statement - PythonForBeginners.com
Python tuple exercises tutorial
Python tuple exercises tutorial
Data Structure in Python
Data Structure in Python
🐍 Python Tuples Explained | Immutability, Indexing, Slicing & Unpacking
🐍 Python Tuples Explained | Immutability, Indexing, Slicing & Unpacking
Python Tuples
Python Tuples
a table with numbers and symbols for different types of items in each language, including the words
a table with numbers and symbols for different types of items in each language, including the words
Master Python Tuple 🧩 | Simple & Aesthetic Python Cheatsheet
Master Python Tuple 🧩 | Simple & Aesthetic Python Cheatsheet
Python Tuple Sort | How to Sort Python Tuples? | Sorting Tuples ⋆ IpCisco
Python Tuple Sort | How to Sort Python Tuples? | Sorting Tuples ⋆ IpCisco
an image of a computer screen with the words set and multiples in different languages
an image of a computer screen with the words set and multiples in different languages
30-Day Python Learning Plan for Beginners | Complete Python Roadmap to Learn Coding Fast
30-Day Python Learning Plan for Beginners | Complete Python Roadmap to Learn Coding Fast
Data Types In Python
Data Types In Python
Python Data Structures Cheat Sheet for Beginners (Lists, Tuples, Sets & Dictionaries)
Python Data Structures Cheat Sheet for Beginners (Lists, Tuples, Sets & Dictionaries)
Float Data Type in Python – Master It in Seconds!
Float Data Type in Python – Master It in Seconds!

You can access any tuple item using its index in square brackets.

print(my_tuple[1]) will output: 2

Tuple Length

You can obtain the length of a tuple using the len() function.

print(len(my_variable_tuple)) will output: 5

Lastly, remember tuples are immutable. This means you can't change or remove items once the tuple is created. But, you can cast or change a tuple to other types like lists and then make adjustments.

In Python, tuples play a pivotal role and are extensively used in scenarios where you don't need alteration of data. For instance, they are ideal for data that must be constant in an algorithm, as they provide a safety guard against accidental modification. It's therefore a worthwhile concept to master.