It's O(n), also check out: http://wiki.python.org/moin/TimeComplexity

This page documents the time-complexity (aka "Big O" or "Big Oh") of various operations in current CPython. Other Python implementations (or older or still-under development versions of CPython) may have slightly different performance characteristics. However, it is generally safe to assume that they are not slower by more than a factor of O(log n)...

Answer from Zach Kelling on Stack Overflow
🌐
Finxter
blog.finxter.com › home › learn python blog › python list index() – a simple illustrated guide
Python List index() - A Simple Illustrated Guide - Be on the Right Side of Change
June 19, 2021 - For n elements, the runtime complexity is O(n) because in the worst-case you need to iterate over each element in the list to find that the element does not appear in it. Let’s check the runtime complexity practically for different list sizes ...
Discussions

python - what is the time complexity of list.index(obj) method? - Stack Overflow
This page documents the time-complexity (aka "Big O" or "Big Oh") of various operations in current CPython. Other Python implementations (or older or still-under development versions of CPython) may have slightly different performance characteristics. More on stackoverflow.com
🌐 stackoverflow.com
algorithm - python str.index time complexity - Stack Overflow
Does this mean we should implement ... builtin index() for time critical processes ? 2016-04-26T15:11:15.09Z+00:00 ... I think that thread has a good answer about that topic: programmers.stackexchange.com/questions/183725/… 2016-04-26T15:25:13.243Z+00:00 ... Save this answer. ... Show activity on this post. its a combination of a few algorithms- look at this · Python string 'in' operator implementation algorithm and time complexity... More on stackoverflow.com
🌐 stackoverflow.com
python - Improving the time complexity of a function that returns the index of the first occurrence of an element in a list - Stack Overflow
UPDATE 1 (Oct.16): The original code had a few logic errors which were rectified. The updated code below should now produce the correct output for all lists L, S.T they meet the criteria for a spec... More on stackoverflow.com
🌐 stackoverflow.com
Does pop(i) have a Time Complexity of O(n) or O(k)?
I'm reading a book on data structures and algorithms in python and the say pop(i) is O(n) but on Python's website it states that pop intermediate is… More on reddit.com
🌐 r/learnpython
3
3
July 1, 2020
🌐
DEV Community
dev.to › williams-37 › understanding-time-complexity-in-python-functions-5ehi
Understanding Time Complexity in Python Functions - DEV Community
October 25, 2024 - Inserting an element at a specific index requires shifting elements, resulting in linear time complexity. ... Removing an element (by value) requires searching for the element first, which takes linear time. ... Python’s built-in sorting algorithm (Timsort) has a time complexity of O(n log ...
🌐
Analytics Vidhya
analyticsvidhya.com › home › how can i manipulate python list elements using indexing?
How can I Manipulate Python List Elements Using Indexing?
January 22, 2024 - Direct indexing has a time complexity of O(1), while using the index() method for searching has a time complexity of O(n).
🌐
Quora
quora.com › How-do-Python-lists-maintain-constant-time-complexity-for-indexing-if-their-elements-can-be-of-more-than-one-type
How do Python lists maintain constant time complexity for indexing if their elements can be of more than one type? - Quora
Answer (1 of 4): in a C arrays where the data is held in contiguous memory, you are right that indexing couldn’t be constant time in a heterogeneous container as you would have to sum the widths of all of the previous items before being able to fetch an item (or you would need to keep a separate ...
🌐
AlgoCademy
algocademy.com › link
Time Complexity Guidelines in Python | AlgoCademy
A common pitfall is overthinking the problem and trying to iterate through the array, which would result in a linear time complexity, O(n). To solve this problem, we need to directly access the first element of the array. In Python, accessing an element by its index is an O(1) operation.
🌐
Medium
medium.com › @ivanmarkeyev › understanding-python-list-operations-a-big-o-complexity-guide-49be9c00afb4
Understanding Python List Operations: A Big O Complexity Guide | by Ivan Markeev | Medium
June 4, 2023 - In this article, we will explore the Big O complexity of common list operations, helping you make informed decisions about algorithm design and performance optimizations. Accessing an element in a Python list by its index is an efficient operation with constant time complexity.
Find elsewhere
🌐
Apps Developer Blog
appsdeveloperblog.com › home › python › python list index()
Python List index() - Apps Developer Blog
January 27, 2023 - The index function finds the match by checking every element of the list until the match is found. Thus, for a smaller list, this is a good choice. But if you are dealing with huge lists and you are not sure whether the match will be found or not, then this function is not. This will increase the time cost of your code. So the longer the list, the more amount of time it will take. To avoid the time complexity, you can narrow down the search by giving the start and end parameters.
🌐
Python
wiki.python.org › moin › TimeComplexity
TimeComplexity - Python Wiki
This page documents the time-complexity (aka "Big O" or "Big Oh") of various operations in current CPython. Other Python implementations (or older or still-under development versions of CPython) may have slightly different performance characteristics.
🌐
UCI
ics.uci.edu › ~pattis › ICS-33 › lectures › complexitypython.txt
The Complexity of Python Operators/Functions
The average list slice taken in ... O(1) - always executed in worst case; use The complexity class for executing the entire function is O(N)*O(N)*O(1) + O(1) = O(N**2). So we know from the previous lecture that if we double the length of alist, this function takes 4 times ...
🌐
Shiksha
shiksha.com › home › it & software › colleges in india
Best IT & Software Colleges in India - Courses, Fees, Admissions 2026, Cutoff, Placements
December 16, 2024 - Find 12406 best IT & Software Colleges in India. Compare Fees, IT & Software Courses, Admission Process, Accepted Exams, Cut off, Placements, and Student Reviews.
🌐
Reddit
reddit.com › r/learnpython › does pop(i) have a time complexity of o(n) or o(k)?
r/learnpython on Reddit: Does pop(i) have a Time Complexity of O(n) or O(k)?
July 1, 2020 - ... O(k) when k = n-1 is really the same as O(n) where time complexity is concerned. ... The time complexity depends not on n, but on the index value to list.pop(), which is possibly a function of n, or not.
🌐
Bradfield CS
bradfieldcs.com › algos › analysis › performance-of-python-types
Performance of Python Types
However, the expansion rate is cleverly chosen to be three times the previous size of the array; when we spread the expansion cost over each additional append afforded by this extra space, the cost per append is ... O(1)O(1) on an amortized basis. ... Popping from a Python list is typically performed from the end but, by passing an index, you can pop from a specific position.
🌐
ESS Institute
essinstitute.in › home › blog › introduction to time complexity in python
Introduction to Time complexity in Python | ESS Institute
June 3, 2023 - Data structures in Python can have a variety of time complexity, including: 1. O(1) – Constant Time Complexity: This denotes that the amount of time required to complete an operation is constant and independent of the amount of input data.
🌐
Stack Exchange
cs.stackexchange.com › questions › 138847 › time-complexity-verification-code-with-two-loops-with-an-index-halved-at-each-i
Time-Complexity Verification: Code with two loops with an index halved at each iteration - Computer Science Stack Exchange
April 11, 2021 - And at the $ith$ iteration the for-loop runs $ \frac{n}{2^i} $ times; inside the for-loop the conditional runs at most $ O(n) $ times ( because "in" has complexity of $ O(n) $ according to https://wiki.python.org/moin/TimeComplexity ).
🌐
GeeksforGeeks
geeksforgeeks.org › python › complexity-cheat-sheet-for-python-operations
Complexity Cheat Sheet for Python Operations - GeeksforGeeks
July 12, 2025 - This cheat sheet is designed to help developers understand the average and worst-case complexities of common operations for these data structures that help them write optimized and efficient code in Python. Python's list is an ordered, mutable sequence, often implemented as a dynamic array. Below are the time complexities for common list operations: