Is there a a better way to remove the last N elements of a list.
for i in range(0,n):
if you wish to remove the last n elements, in other words, keep first len - n elements:
lst = lst[:n-1]
Note: This is not an in memory operation. It would create a copy.