Tuple in Python Class 11 Notes Computer Science/ Informatics Practices

Last updated on August 9th, 2026 at 07:35 pm

Tuple in Python Class 11 Notes : Easy Notes for CBSE Students

 

Welcome to the complete Tuple in Python โ€” Class 11 Notes. A tuple is a close cousin of the list, but with one big difference โ€” it’s immutable, and that single fact drives almost every board question on this chapter. These notes cover the complete CBSE syllabus โ€” indexing, all tuple operations, every built-in function/method, tuple assignment, nested tuples, and the suggested programs โ€” with syntax, examples and outputs.

๐Ÿ’ก Exam tip: “Why is a tuple faster than a list?” and “How do you write a tuple with one element?” are two of the most repeated 1-mark questions on this chapter. Both are answered below โ€” don’t skip the tips boxes!

Quick Overview โ€” What You Will Learn

#TopicKey ConceptsExam Weight
1Introduction to TuplesDefinition, creation, immutabilityโญโญโญ
2Tuple IndexingPositive index, negative indexโญโญ
3Tuple OperationsConcatenation, Repetition, Membership, Slicingโญโญโญ
4Built-in Functions/Methodslen(), tuple(), count(), index(), sorted(), min(), max(), sum()โญโญโญ
5Tuple AssignmentPacking, unpacking, swapping valuesโญโญ
6Nested TupleTuple of tuples, double indexingโญโญ
7Suggested ProgramsMin/Max/Mean, Linear Search, Frequency Countโญโญโญ

Section 1 ยท Introduction ยท โญโญโญ

๐Ÿ“ฆ What is a Tuple in Python?

A tuple is an ordered, immutable collection of items enclosed in round brackets ( ), with items separated by commas. Once created, its elements cannot be changed, added, or removed.

OrderedImmutableHeterogeneousAllows duplicates

subjects = (“Maths”, “Science”, “English”)
print(subjects)
print(type(subjects))
(‘Maths’, ‘Science’, ‘English’)
<class ‘tuple’>

Single-Element Tuple โ€” the Most Common Mistake

A tuple with only one item needs a trailing comma โ€” without it, Python treats the brackets as normal parentheses, not a tuple!

single_item = (“apple”,) # Correct โ€” this IS a tuple
not_a_tuple = (“apple”) # Wrong โ€” this is just a string

print(type(single_item))
print(type(not_a_tuple))

<class ‘tuple’>
<class ‘str’>
โš ๏ธ Board favourite: “How do you create a tuple with a single element?” โ€” the answer is always: add a trailing comma, e.g. (5,) not (5).

Creating a Tuple โ€” 3 Ways

# 1. Using round brackets
fruits = (“apple”, “banana”, “orange”)

# 2. Without any brackets at all (tuple packing)
point = 10, 20
print(type(point)) # still a tuple!

# 3. Using the tuple() constructor
numbers = tuple([1, 2, 3])
print(numbers)

<class ‘tuple’>
(1, 2, 3)

Section 2 ยท Indexing ยท โญโญ

๐Ÿ”ข Tuple Indexing

Just like lists, every tuple element has a fixed position โ€” its index. Python supports positive indexing (0 onward) and negative indexing (-1 onward from the end).

Elementredbluegreen
Positive Index012
Negative Index-3-2-1
colors = (“red”, “blue”, “green”)

print(colors[1]) # blue
print(colors[-1]) # green (last item)
print(colors[5]) # IndexError: tuple index out of range

โš ๏ธ Indexing lets you read a tuple element, but you can never assign to it: colors[0] = "black" raises TypeError: 'tuple' object does not support item assignment.

Section 3 ยท Tuple Operations ยท โญโญโญ

โš™๏ธ Tuple Operations

CBSE syllabus defines four core tuple operations โ€” concatenation, repetition, membership and slicing โ€” the same four operations you learnt for lists and strings.

1. Concatenation ( + )

Joins two tuples into a new tuple. Since tuples are immutable, this always creates a brand-new tuple โ€” the originals stay untouched.

tuple1 = (1, 2)
tuple2 = (3, 4)
result = tuple1 + tuple2
print(result)
(1, 2, 3, 4)

2. Repetition ( * )

tuple1 = (“Hi”,)
print(tuple1 * 3)
(‘Hi’, ‘Hi’, ‘Hi’)

3. Membership ( in, not in )

fruits = (“apple”, “banana”)
print(“apple” in fruits)
print(“mango” not in fruits)
True
True

4. Slicing

Slicing extracts a portion of a tuple as a new tuple. Syntax: tuple[start : stop : step] โ€” the stop index is never included.

colors = (“red”, “blue”, “green”, “yellow”, “pink”)

print(colors[0:2]) # first two items
print(colors[2:]) # from index 2 to end
print(colors[::2]) # every 2nd item
print(colors[::-1]) # reversed tuple

(‘red’, ‘blue’)
(‘green’, ‘yellow’, ‘pink’)
(‘red’, ‘green’, ‘pink’)
(‘pink’, ‘yellow’, ‘green’, ‘blue’, ‘red’)
โœ… Memorise: tuple[::-1] reverses any tuple โ€” just like it does for lists and strings.

Section 4 ยท Built-in Functions/Methods ยท โญโญโญ

๐Ÿ› ๏ธ Built-in Functions and Methods on Tuples

The CBSE syllabus lists exactly these functions/methods for tuples: len(), tuple(), count(), index(), sorted(), min(), max(), sum(). Notice โ€” tuples do not have append(), remove(), sort(), or insert(), because those would modify the tuple, and tuples are immutable!

len() and tuple()

my_tuple = (1, 2, 3)
print(len(my_tuple)) # 3

print(tuple(“CS”)) # string to tuple
print(tuple([1, 2, 3])) # list to tuple

3
(‘C’, ‘S’)
(1, 2, 3)

count() and index()

numbers = (1, 2, 2, 3, 2)
print(numbers.count(2)) # 3
print(numbers.index(3)) # 3 — first index found
3
3

sorted()

There is no sort() method for tuples (that would change them in place). Use the built-in function sorted() instead โ€” it returns a new sorted list, not a tuple!

marks = (90, 85, 88, 92)
print(sorted(marks))
print(type(sorted(marks)))
[85, 88, 90, 92]
<class ‘list’>
โš ๏ธ Exam Alert: sorted(tuple) always returns a list, never a tuple. If you need the result back as a tuple, wrap it again: tuple(sorted(marks)).

min(), max() and sum()

marks = (90, 85, 88, 92)
print(min(marks))
print(max(marks))
print(sum(marks))
print(sum(marks) / len(marks)) # mean
85
92
355
88.75

๐Ÿ“‹ Complete Summary Table โ€” All CBSE Syllabus Tuple Methods

Function/MethodWhat it DoesReturns
len(tuple)Number of elementsint
tuple(seq)Converts a sequence into a tupletuple
count(x)Counts occurrences of xint
index(x)Index of first occurrence of xint
sorted(tuple)Sorted elements (does NOT change the tuple)list
min(tuple)Smallest elementelement type
max(tuple)Largest elementelement type
sum(tuple)Sum of numeric elementsint/float

Section 5 ยท Tuple Assignment ยท โญโญ

๐Ÿ”— Tuple Assignment (Packing & Unpacking)

Tuple assignment lets you assign multiple variables in a single line. Packing groups values into a tuple; unpacking splits a tuple back into separate variables. The number of variables on the left must match the number of values on the right.

# Packing โ€” values packed into a tuple
student = (“Amit”, 16, 88.5)

# Unpacking โ€” tuple values assigned to separate variables
name, age, marks = student
print(name)
print(age)
print(marks)

Amit
16
88.5
# Swapping two values — classic use of tuple assignment
a = 5
b = 10
a, b = b, a
print(a, b)
10 5
โœ… Board favourite: “Swap two variables without using a third variable” โ€” the one-line answer is always a, b = b, a, and it works because Python packs the right side into a tuple first, then unpacks it.

Section 6 ยท Nested Tuple ยท โญโญ

๐Ÿงฉ Nested Tuples

A nested tuple is a tuple inside another tuple โ€” useful for grouping related fixed records together, like coordinates or student records.

student = (“Amit”, 16, (78, 85, 92))
points = ((1, 2), (3, 4), (5, 6))

print(student[2]) # (78, 85, 92)
print(student[2][1]) # 85
print(points[1][0]) # 3

for pt in points:
print(pt)

(78, 85, 92)
85
3
(1, 2)
(3, 4)
(5, 6)
๐Ÿ’ก Access nested elements with double indexing, exactly like nested lists: outer_tuple[i][j].

Section 7 ยท Suggested Programs ยท โญโญโญ

๐Ÿ’ป Common Programs for CBSE Practicals & Board Exams

Program 1 โ€” Minimum, Maximum and Mean of a Tuple

numbers = (23, 45, 12, 89, 34, 67)

minimum = min(numbers)
maximum = max(numbers)
mean = sum(numbers) / len(numbers)

print(“Minimum:”, minimum)
print(“Maximum:”, maximum)
print(“Mean:”, mean)

Without using built-in functions (common exam variant):

numbers = (23, 45, 12, 89, 34, 67)
minimum = numbers[0]
maximum = numbers[0]
total = 0

for n in numbers:
if n < minimum:
minimum = n
if n > maximum:
maximum = n
total += n

mean = total / len(numbers)
print(“Minimum:”, minimum, ” Maximum:”, maximum, ” Mean:”, mean)

Program 2 โ€” Linear Search on a Tuple of Numbers

numbers = (23, 45, 12, 89, 34, 67)
search_value = int(input(“Enter number to search: “))
found = False

for i in range(len(numbers)):
if numbers[i] == search_value:
print(“Found at index:”, i)
found = True
break

if not found:
print(“Value not found in the tuple”)

Program 3 โ€” Counting Frequency of Elements in a Tuple

numbers = (10, 20, 10, 30, 20, 10, 40)
freq = {}

for n in numbers:
if n in freq:
freq[n] += 1
else:
freq[n] = 1

for key, value in freq.items():
print(key, “occurs”, value, “time(s)”)

10 occurs 3 time(s)
20 occurs 2 time(s)
30 occurs 1 time(s)
40 occurs 1 time(s)
๐Ÿ’ก For a single value, numbers.count(10) gives its frequency in one line โ€” no loop needed.

โš–๏ธ Tuple vs List โ€” Quick Comparison

FeatureTupleList
Brackets( )[ ]
Mutable?NoYes
SpeedFasterSlower
Methods availablecount(), index()append(), remove(), sort(), insert() + more
Use caseFixed data that shouldn’t changeData that will grow, shrink, or change

Frequently Asked Questions

Why are tuples faster than lists?
Because tuples are immutable, Python can store and access them more efficiently โ€” it doesn’t need to allow for resizing or in-place changes, so operations are quicker and use less memory.

How do you create a tuple with a single element?
Add a trailing comma after the value: (5,). Without the comma, (5) is treated as a plain integer, not a tuple.

Can you change an element of a tuple?
No. Tuples are immutable โ€” tuple[0] = "new value" raises a TypeError. To “change” a tuple, you must create a new one.

What does sorted() return when used on a tuple?
It returns a new list of the sorted elements โ€” not a tuple. Use tuple(sorted(t)) if you need a sorted tuple.

What is tuple unpacking?
Assigning the elements of a tuple to separate variables in one line, e.g. name, age = ("Amit", 16). The number of variables must match the number of values.

Why can’t tuples be sorted in place like lists?
Because sort() changes a list’s elements directly, and that kind of in-place modification is not allowed for an immutable tuple.


Quick Practice Links

๐Ÿ“ Tuple MCQs Class 11  |  Python Compiler  |  ๐Ÿ“‚ Practical File  |  ๐Ÿ“– All Class 11 Notes

Explore More Class 11 CS Notes

๐Ÿ“„ Python List  |  ๐Ÿ“Œ Python String  |  ๐Ÿ“– Python Dictionary  |  ๐Ÿ”ง Python Functions

Found an error or a missing example? Drop a comment below โ€” we fix issues quickly. If these notes helped you, share this page with your classmates!

Jitendra Singh
โœ” Verified Educator

Jitendra Singh

Founder of CBSEPython.in

I help CBSE Class 9โ€“12 students learn Python, Information Technology, Artificial Intelligence and Computer Science through easy notes, quizzes, MCQs and sample papers.

Read More About Me โ†’