0% found this document useful (0 votes)
10 views1 page

Python Tuple Methods Explained

Uploaded by

Keshav Pandey
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views1 page

Python Tuple Methods Explained

Uploaded by

Keshav Pandey
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Methods of Python Tuple

count(item):

Description: Returns the number of occurrences of the specified item in the tuple.

Example:

tup = (1, 2, 2, 3)

count = [Link](2) # 2

index(item, start=0, end=len(tup)):

Description: Returns the index of the first occurrence of the specified item.

Example:

tup = (1, 2, 3)

index = [Link](2) # 1

You might also like