Deleting the first element of a python list in time complexity O(1) , without using predefined list functions

Viewed 39

I want to delete the first element of a list (l[0]) at constant time. I was wondering if del l[0] would do it! If not, is there any other way?

1 Answers

There are many ways to delete the first element of a list :

l = l[1:]
or 
l.pop(0)
or 
del l[0]
Related