Let's say I got the following array:
array = [[1, 2, 3, 1],
[4, 5, 6, 4],
[7, 8, 9, 7],
[7, 8, 9, 7]]
I want to remove the first and last list in the array and than the first and last element of the middle lists (return should basically be: [[5, 6], [8, 9]]).
I tried the following:
array.remove(array[0])
array.remove(array[-1])
for i in array:
array.remove(i[0])
array.remove(i[-1])
But I always get ValueError: list.remove(x): x not in list. Why?