Python Tuple Methods

Python Tuple Methods

Python has two built-in methods that are used for tuples. The following are the two methods:

Method Description
count() The tuple.count() method in Python returns the number of times a specified value appears in the tuple.
index() The tuple.index() method in Python returns the smallest index of the specified element in the tuple.

Example 1

Output

Example 2

Output