O(n) where n is the length of the slice. Slicing is just "copy part of the list" so time complexity is the same as copy. Answer from novel_yet_trivial on reddit.com
Discussions

Time complexity of python slice operation - 💡-string-window - Coding Blocks Discussion Forum
what is the time complexity of slicing in python. Example: lis[2:] I wrote a program in leetcode with lis slicing and without lis slicing and still got the same time result. More on discuss.codingblocks.com
🌐 discuss.codingblocks.com
4
0
August 1, 2020
List-Slicing

It means the time it takes for something to happen doesn't depend on the size of the input. It deals with the subject of Time Complexity. As far as Python is concerned, list-slicing doesn't take constant time, it's bounded by a some kind of factor depending on the slice operation. You can refer to this page which documents the time complexity for common operations.

Anything with O(1) is something that's completed in constant time. The time complexity for get, set, and del slice operations are affected by either n, k, or some combination of those two. The page itself explains what those variables mean more concisely than I can, so refer to the introduction section for more information on those.

More on reddit.com
🌐 r/learnpython
6
7
October 3, 2017
Time and Space complexity of Python list-slicing inside recursive calls
did you mean to write len(s) <= 1? More on reddit.com
🌐 r/leetcode
8
9
February 12, 2023
list - Python Set Slice Complexity - Stack Overflow
Assume that I have two lists named a and b of both size n, and I want to do the following slice setting operation with k < n ... In the Python wiki's Time Complexity page it says that the complexity of slice setting is O(n+k) where k is the length of the slice. More on stackoverflow.com
🌐 stackoverflow.com
🌐
FavTutor
favtutor.com › blogs › python-list-slicing
Python List Slicing (with Examples)
September 23, 2024 - List slicing in Python has a time complexity of O(k), where k is the number of elements in the slice.
🌐
Coding Blocks
discuss.codingblocks.com › t › time-complexity-of-python-slice-operation › 99497
Time complexity of python slice operation - 💡-string-window - Coding Blocks Discussion Forum
August 1, 2020 - what is the time complexity of slicing in python. Example: lis[2:] I wrote a program in leetcode with lis slicing and without lis slicing and still got the same time result.
🌐
CodeRivers
coderivers.org › blog › list-slicing-time-complexity-python
Understanding List Slicing Time Complexity in Python - CodeRivers
February 22, 2026 - The basic syntax is list[start... between each element in the slice. The time complexity of basic list slicing list[start:stop] (when step is 1) is O(k), where k is the number of elements in the resulting slice....
🌐
Medium
medium.com › @dfashimpaur › writing-algorithms-in-python-d852d70759dc
The Power of List Slicing: Writing Better Algorithms In Python
November 10, 2025 - Concatenation (+) of the two slices is also O(N), because it creates a new list · This leaves a total time cost for the slicing approach is O(N) with respect to the input size. This is the best possible Time Complexity for a full-array rotation ...
🌐
Quora
quora.com › What-are-the-time-complexity-considerations-of-lists-in-Python
What are the time complexity considerations of lists in Python? - Quora
Answer: In a normal list on average: * Append : O(1) * Extend : O(k) - k is the length of the extension * Index : O(1) * Slice : O(k) * Sort : O(n log n) - n is the length of the list * Len : O(1) * Pop : O(1) - pop from end * Insert : O(n) - n is the length of the list * Del : O(n) - n...
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-alternate-range-slicing-in-list
Python | Alternate range slicing in list - GeeksforGeeks
April 18, 2023 - The original list : [2, 4, 6, 8, 9, 10, 12, 16, 18, 20, 7, 30] The alternate range sliced list : [8, 9, 10, 20, 7, 30] Time complexity: O(n), where n is the length of the list, as the list comprehension and the enumerate() function both have ...
🌐
Python
wiki.python.org › moin › TimeComplexity
TimeComplexity - Python Wiki
[2] = Popping the intermediate ... 1 moves. The average case for an average value of k is popping the element the middle of the list, which takes O(n/2) = O(n) operations....
🌐
YouTube
youtube.com › watch
Understanding Time and Space Complexity of Python List-Slicing in Recursive Functions - YouTube
Explore the `time` and `space complexity` involved in Python's list-slicing within recursive calls. Learn how string reversal can lead to O(n²) complexity an...
Published   April 8, 2025
Views   2
🌐
Esaezgil
esaezgil.com › home › python lists pop vs slice performance
Python lists: pop vs slice performance - Enrique Saez
February 22, 2017 - t1 = timeit.Timer('a=50*[\'a\'];a.pop(0)') t2 = timeit.Timer('b=50*[\'b\'];b[1:]') t1.timeit(10000)/10000 6.973965995712205e-07 t2.timeit(10000)/10000 8.281046990305186e-07
🌐
Bradfield CS
bradfieldcs.com › algos › analysis › performance-of-python-types
Performance of Python Types
Slice operations require more thought. To access the slice [a:b] of a list, we must iterate over every element between indices a and b. So, slice access is ... O(n)O(n) since we must reposition each element. Finally (and least intuitively), sorting in Python is
🌐
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 - When inserting or deleting an element at the beginning or middle of a Python list, the remaining elements must be shifted to accommodate the change. As a result, these operations have a linear time complexity of O(n).
🌐
Python Reference
python-reference.readthedocs.io › en › latest › docs › brackets › slicing.html
[] (slicing) — Python Reference (The Right Way) 0.1 documentation
>>> +---+---+---+---+ >>> |-4 |-3 |-2 |-1 | <= negative indexes >>> +---+---+---+---+ >>> | A | B | C | D | <= sequence elements >>> +---+---+---+---+ >>> | 0 | 1 | 2 | 3 | <= positive indexes >>> +---+---+---+---+ >>> |<- 0:3:1 ->| <= extent of the slice: "ABCD"[0:3:1]
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-sliced-product-in-list
Python | Sliced Product in List - GeeksforGeeks
April 22, 2023 - Time complexity: O(n), where n is the length of the test_list. The list slicing + loop takes O(n) time Auxiliary Space: O(1), constant extra space is required · Method #2 : Using islice() + loop The inbuilt functions can also be used to perform ...
🌐
Stack Overflow
stackoverflow.com › questions › 75424380 › time-and-space-complexity-of-python-list-slicing-inside-recursive-calls
algorithm - Time and Space Complexity of Python list-slicing inside recursive calls - Stack Overflow
Hence, both time and space complexities are O(n^2) (the quadratic space complexity dominates the linear recursive space needed). ... Yes s[1:] is O(n). So it is O(n + n-1 + n-2 + ... + 2 + 1) = O(n²) ... Yes, you are right. The space complexity ...