Obtenga todos los elementos excepto el último elemento de la lista de Python

x = [1, 2, 3, 4]

#same array, but the last item.
notLast = x[0:-1]
Aggam R.