Comprehensive notes Tuple functions and methods Class 11

If you are looking for notes Tuple functions and methods Class 11 you are landed on the right page. Here we are going to discuss Comprehensive notes Tuple functions and methods Class 11. Before starting if you missed the articles how to create tuples and QnA creating tuples follow the below given links:

Recommended – Tuple Creation and Traversal

Suggested – QnA Tuple Creation and Traversal

Now let’s start the article Comprehensive notes Tuple functions and methods Class 11. Here we go!

Comprehensive notes Tuple functions and methods Class 11

As we already covered list methods, similarly we tuple functions and methods. These functions and methods are one of the topics of Class 11 curriculum. So in this article we discuss some standard library methods or functions, and tuple methods and function used to manipulate the tuples in Comprehensive notes Tuple functions and methods Class 11.

Standard Library Methods

In this category for Comprehensive notes Tuple functions and methods Class 11, we will discuss abut following standard library methods.

  1. len()
  2. max()
  3. min()
  4. sum()
  5. sorted()

len() function

This function returns the length of a tuple. The length of tuple means total number of elements present in the list.

For example,

t = (22,44,56,78)
print("The tuple contains",len(t), " elements")

max() function

The max function returns the maximum value from the specified tuple.


In string it will return the highest ordered letter as maximum.


This function will only work with tuples having similar data type only. If multiple datatypes combined in the single tuple and you want to print the max() value this function won’t work.

min() function

It will returns minimum value from the sequence specified in the tuple.


Rest min() will work as max().

sum() function

It will return the sum of values used in the tuple sequence.


This function only works with numeric elements.

sorted() function

It will returns the tuple elements in ascending or descending order in form of list.


For descending order use reverse=True as another parameter. Have a look at this code:

print(sorted(t, reverse=True))

Tuple Methods or Functions

In this category we are using methods or function with dot symbol. These methods or functions are as following:

  1. tuple()
  2. index()
  3. count()

tuple() function

As we have seen in the tuple creation, this function convert any sequence of lists into tuple.

index() function

It will return the index of specified tuple element value.


The output of above code is 2.

count() function

This function will display number of frequency of elements available in the tuple.


Above code will return 3 as output as 2 is repeated 3 times in the tuple.

Linear search in the tuple

To search in tuple, follow these steps:

  1. Start with the leftmost element in the tuple
  2. Take one variable to flag the message element found on 1
  3. Take a variable to search an element
  4. Traverse the tuple using for loop
  5. Compare the element with the search element
  6. Update the flag variable to 1
  7. Outside the loop, print a message element found or not, using if for the flag variable
def search():
    t = (3,4,1,5,6,8)
    n = int(input("Enter the value to search:"))
    for i in range(len(t)): 
        if t[i] == n: 
    if f==1:
        print("Not Found")

Mean of values stored in the tuple

To find the mean of values in tuple, follow the below given steps:

  1. Import a package statistics
  2. Define the tuple with the values
  3. Declare a variable to store the mean of tuple values
  4. The mean can be displayed with float value so use round function to restrict its decimal places
  5. Use print to print the final value

Observe the following code:

import statistics 
t = (1, 3, 4, 5, 7, 9, 2 )
meanoftuple = round(statistics.mean(t) ,2)
print("Mean is :", meanoftuple) 

That’s all from the topic Tuple functions and methods Class 11. I hope that all the concepts are clear to you. If any specific doubt or query you have, you are free to ask through the comment section.

Share your views on this article as your token of love and support.

Thank you very much for reading this article.

If you are looking for more contents for Class 11, follow the below given link:

Recommended – Computer Science Class 11

Leave a Reply