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
🌐
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).
Discussions

algorithm - python str.index time complexity - Stack Overflow
For finding the position of a substring, inside a string, a naive algorithm will take O(n^2) time. However, using some efficient algorithms (eg KMP algorithm), this can be achieved in O(n) time: s... More on stackoverflow.com
🌐 stackoverflow.com
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
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
python - What is the time complexity to get the last index for an array? - Stack Overflow
for the given array it takes O(1) ... ends at index 3 by default ? In other words how is array[-1] is implemented in python? ... That's not an array, it's a list. ... Save this answer. Show activity on this post. Accessing any array element is in constant time, since it is ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
GeeksforGeeks
geeksforgeeks.org › python › complexity-cheat-sheet-for-python-operations
Complexity Cheat Sheet for Python Operations - GeeksforGeeks
July 12, 2025 - Dictionaries in Python are implemented as hash tables, making them highly efficient for key-based operations. Here are the complexities: Note: Defaultdict has operations same as dict with same time complexity as it inherits from dict.
🌐
Python
wiki.python.org › moin › TimeComplexity
TimeComplexity - Python Wiki
Note that there is a fast-path ... complexity, but it can significantly affect the constant factors: how quickly a typical program finishes. [1] = These operations rely on the "Amortized" part of "Amortized Worst Case". Individual actions may take surprisingly long, depending on the history of the container. [2] = Popping the intermediate element at index k from a list ...
🌐
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 - Under the hood, lists use an underlying array structure to store their elements. This enables direct access to any element by index, resulting in O(1) complexity. Regardless of the size of the list, accessing an element takes the same amount of time.
🌐
DEV Community
dev.to › williams-37 › understanding-time-complexity-in-python-functions-5ehi
Understanding Time Complexity in Python Functions - DEV Community
October 25, 2024 - ... 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 n) in the average and worst cases.
🌐
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 ...
Find elsewhere
🌐
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
The code is straightforward and leverages Python's ability to access list elements in constant time. The time complexity of the optimized solution is O(1) because accessing an element by its index in a list is a constant time operation.
🌐
Medium
medium.com › data-science › understanding-time-complexity-with-python-examples-2bda6e8158a7
Understanding time complexity with Python examples | by Kelvin Salton do Prado | TDS Archive | Medium
February 15, 2020 - If the search value is equal to the value in the middle of the list, return the middle (the index). Repeat the steps above until the value is found or the left bounder is equal or higher the right bounder. It is important to understand that an algorithm that must access all elements of its input data cannot take logarithmic time, as the time taken for reading input of size n is of the order of n. An algorithm is said to have a linear time complexity when the running time increases at most linearly with the size of the input data.
🌐
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.
🌐
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 - I'm reading a book on data structures ... that you popped but please correct me if I'm misunderstanding something. Share ... O(k) when k = n-1 is really the same as O(n) where time complexity is concerned....
🌐
Codecademy
codecademy.com › docs › python › lists › .index()
Python | Lists | .index() | Codecademy
June 11, 2025 - In the worst case, the .index() method has O(n) time complexity, as it may need to check every element. Consider using dictionaries or other data structures that offer faster lookup times for frequently repeated searches on large lists.
🌐
Python
docs.python.org › 3.16 › library › time-complexity.html
Time complexity of operations on built-in types — Python 3.16.0a0 documentation
We use Big O notation to describe how the running time of an operation grows with the size of its inputs. Unless stated otherwise, n denotes the number of elements currently in the container, and k is the value of a numeric parameter, such as an index or a repeat count.
🌐
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 12502 best IT & Software Colleges in India. Compare Fees, IT & Software Courses, Admission Process, Accepted Exams, Cut off, Placements, and Student Reviews.
🌐
YourBasic
yourbasic.org › algorithms › time-complexity-arrays
Time complexity of array/list operations [Java, Python] · YourBasic
The worst-case time complexity is linear. Similarly, searching for an element for an element can be expensive, since you may need to scan the entire array. In this Python code example, the linear-time pop(0) call, which deletes the first element ...