return everything exept the last list python code example
Example 1: python list except last element
>>> myList = list(range(1,5))
>>> myList
[1, 2, 3, 4]
>>> myList = myList[:-1]
>>> myList
[1, 2, 3]
Example 2: python remove last element from list
record = record[:-1]