Remove the last N elements of a list June 30, 2023 by Tarik Works for n >= 1 >>> L = [1,2,3, 4, 5] >>> n=2 >>> del L[-n:] >>> L [1, 2, 3]