Python List index() - Find Index of Item Last Updated : 27 Apr, 2025 Comments Improve Suggest changes Like Article Like Report index() method in Python is a helpful tool when you want to find the position of a specific item in a list. It works by searching through the list from the beginning and returning the index (position) of the first occurrence of the element you're looking for. Example: Python a = ["cat", "dog", "tiger"] print(a.index("dog")) Output1 Explanation: index("dog") method finds the first occurrence of "dog" in the list a. Since "dog" is at index 1, it returns 1.Syntax of List index() methodlist.index(element, start, end)Parameters:element (required): The item to search for.start (optional): Index to start the search from (default is 0).end (optional): Index to end the search (exclusive, default is end of list).Returns:The first index of element in the list within the specified range.Raises ValueError if the element is not found.Examples of List index()Example 1: In this example, we are searching for the index of the number 40 within a specific range of the list from index 4 to 7 . Python a = [10, 20, 30, 40, 50, 40, 60, 40, 70] res = a.index(40, 4, 8) print(res) Output5 Example 2: In this example, we try to find the index of 'yellow' in the list and handle the error with a try-except block if it's not found. Python a = ['red', 'green', 'blue'] try: index = a.index('yellow') print(a) except ValueError: print("Not Present") OutputNot Present Example 3: In this example, we are finding the index of the tuple ("Bob", 22) in a list of tuples and index() will return the position of its first occurrence. Python a = [("Alice", 21), ("Bob", 22), ("Charlie", 20), ("Bob", 24)] res = a.index(("Bob", 22)) print(res) Output1 Also Read:Python Program to Accessing index and value in listPython | Ways to find indices of value in list Python List index() Comment More info S Striver Follow Improve Article Tags : Misc Python python-list Python-Built-in-functions python-list-functions python +2 More Explore Python FundamentalsPython Introduction 3 min read Input and Output in Python 4 min read Python Variables 5 min read Python Operators 5 min read Python Keywords 2 min read Python Data Types 8 min read Conditional Statements in Python 3 min read Loops in Python - For, While and Nested Loops 7 min read Python Functions 5 min read Recursion in Python 6 min read Python Lambda Functions 5 min read Python Data StructuresPython String 5 min read Python Lists 5 min read Python Tuples 4 min read Python Dictionary 3 min read Python Sets 6 min read Python Arrays 7 min read List Comprehension in Python 4 min read Advanced PythonPython OOP Concepts 11 min read Python Exception Handling 5 min read File Handling in Python 4 min read Python Database Tutorial 4 min read Python MongoDB Tutorial 2 min read Python MySQL 9 min read Python Packages 12 min read Python Modules 7 min read Python DSA Libraries 15 min read List of Python GUI Library and Packages 3 min read Data Science with PythonNumPy Tutorial - Python Library 3 min read Pandas Tutorial 6 min read Matplotlib Tutorial 5 min read Python Seaborn Tutorial 15+ min read StatsModel Library- Tutorial 4 min read Learning Model Building in Scikit-learn 8 min read TensorFlow Tutorial 2 min read PyTorch Tutorial 7 min read Web Development with PythonFlask Tutorial 8 min read Django Tutorial | Learn Django Framework 7 min read Django ORM - Inserting, Updating & Deleting Data 4 min read Templating With Jinja2 in Flask 6 min read Django Templates 7 min read Python | Build a REST API using Flask 3 min read How to Create a basic API using Django Rest Framework ? 4 min read Python PracticePython Quiz 3 min read Python Coding Practice 1 min read Python Interview Questions and Answers 15+ min read Like