
There are two common methods used with python tuples. In this lesson, we will focus on these Python Tuple Methods. So what are the Tuple Methods used in python? These are:
Index method is used to access the specified item in the python tuple. With this method, we can access any item in the tuple with an index number given in a square brackets. We can also access to a range of items by using one more parameters with index method.
You can also check Python List Methods
If we use one number, we can access this item only. Let’s show this with an example:
You can watch also the video of this lesson!
You can also check Python Tuples versus Python List
If we give two parameters divided with colon ( : ), we can access a range of items.
You can practice below!
If we use also the third operator, we can access the range of items and we can also jump on these items.

We can also use negative indexes to access any item in the tuple:
The output of this python tuple index method will be like below:
The other method used with python tuples is python count method. With this method, we can count the number of any items in the python tuple.
For example, for the below tuple, let’s count 10.
As you can see below, the output of this python tuple count method will be 3. Because there are three 10s in this tuple.
In this lesson, we have learned the Python Tuple Methods. You can use these methods for different purposes and for different examples.
Gokhan Kosem is a Network Engineer, Instructor and the Founder of IPCisco.com with 15+ years of experience in Cisco, Nokia, Huawei, Juniper, Linux, Service Provider Networks, Routing and Switching technologies.
He has worked on the backbone networks of major service providers and network vendors including Nortel, Alcatel-Lucent (Nokia) and has extensive hands-on experience with Cisco, Huawei, Juniper and Nokia networking technologies.
He has trained thousands of networking students worldwide through IPCisco.com, Udemy, books, labs, quizzes, and educational content across multiple social media platforms.
IPCisco.com | Best Route to Your Dreams
Leave a Reply