Deleting the first element of a list

Mark McEahern marklists at mceahern.com
Wed Oct 2 18:34:38 EDT 2002


> Is using del to delete the first element (that is, the 0th 
> element) of a list faster than x = x[1:]?

n = 100
l = range(n)
del l[0]

// m




More information about the Python-list mailing list