Python Tuple Methods

Beginner
4 min read
Updated: Nov 2026
2 method guides
Method index

About This Index

This page is the Python Tuple Methods index for the tutorial track. A tuple is an ordered group of values that can never change, so it needs far fewer methods than a list: just count() and index(). Each guide has syntax, parameters, return value, three examples with output, and FAQs.

New to tuples? Start with the Tuple hub: creating tuples, the one-item comma trap, indexing, unpacking, and tuples vs lists.

Two methods, both read-only.

Because a tuple is immutable (it cannot be changed after it is created), there is no append(), remove(), pop(), or sort(). Both methods only read the tuple and return an int.

How to Call a Tuple Method

Write the tuple, a dot, the method name, and the value in parentheses. Both methods hand back a number, so print it or store it in a variable:

Python
codes = ("x", "y", "x", "z", "x")
print(codes.count("x"))      # 3
print(codes.count("w"))      # 0
print(codes.index("z"))      # 3
print(codes.index("x", 1))   # 2
print(codes.index("x", -1))  # 4

count("w") returns 0 for a missing value, while index() would raise ValueError for it. The second argument of index() is where the search starts; -1 starts at the last item.

Python Tuple Methods Table

Every tuple method in this Python tutorial series (2 tutorials).

MethodReturnsDescriptionTutorial
count()intCount how many items in a tuple are equal to a value.Try it
index()int (position)Find the position of the first item equal to a value.Try it

Related Tuple Features

These are not tuple methods: they are built-in functions and operators that work on tuples (and other sequences). You will use them next to count() and index() all the time:

CodeWhat it does
len(t)Number of items in the tuple.
x in tTrue if some item is equal to x; it stops at the first match. x not in t is the opposite.
t + otherNew tuple with the items of both; other must be a tuple too, so write t + (5,) to add one item.
t * nNew tuple with the items repeated n times, such as (0,) * 3.
t[i], t[a:b]Read one item by index, or slice out a new tuple from a up to, but not including, b.
a, b = tUnpacking: one name per item. a, *rest = t puts the leftovers in a list.
tuple(iterable)Build a tuple from a list, string, range, or any other iterable.
sorted(t)New sorted list; the tuple stays as it is. Wrap it as tuple(sorted(t)) for a tuple.
min(t), max(t), sum(t)Smallest item, largest item, and the total of numeric items.
list(t)Convert to a list when you really need to add, remove, or sort items in place.
zip(a, b)Pair up the items of two tuples as (a_item, b_item) tuples.
enumerate(t)Loop with (index, item) pairs: every position, not just the first match.
Python
t = (40, 10, 30, 20)
print(len(t), 30 in t)                    # 4 True
print(t + (50,), (0,) * 3)                # (40, 10, 30, 20, 50) (0, 0, 0)
print(t[1:3], t[::-1])                    # (10, 30) (20, 30, 10, 40)
a, b, *others = t
print(a, b, others)                       # 40 10 [30, 20]
print(sorted(t), min(t), max(t), sum(t))  # [10, 20, 30, 40] 10 40 100
print(tuple([1, 2]), list(t))             # (1, 2) [40, 10, 30, 20]

Notice which results are tuples and which are lists: +, *, and slicing build new tuples, but sorted(t), list(t), and the starred name in a, b, *others = t give lists. The original t is the same at the end as at the start.

Frequently Asked Questions

Only two: count(value), which says how many items are equal to the value, and index(value), which gives the position of the first one.
Tuples are immutable. Every list method that changes the list, such as append(), insert(), pop(), remove(), sort(), and reverse(), has no tuple version.
Call sorted(t). It returns a new sorted list and leaves the tuple alone; wrap it as tuple(sorted(t)) if you need a tuple again.
No. They are built-in functions and operators that work on every sequence, so they appear in the related features table on this page instead of the methods table.
You cannot change a tuple, but you can build a new one: t + (4,) adds an item, and t[:2] + t[3:] leaves out the item at index 2.

Start with count()

Open the first tuple method guide: count how many times a value appears.

count() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

11 people found this page helpful