Is there a a better way to remove the last N elements of a list.
for i in range(0,n): lst.pop( )
Works for n >= 1
n >= 1
>>> L = [1,2,3, 4, 5] >>> n=2 >>> del L[-n:] >>> L [1, 2, 3]