In this kata the function returns an array/list of numbers without its last element. The function is already written for you and the basic tests pass, but random tests fail. Your task is to figure out why and fix it.

Good luck!

Hint: watch out for side effects.

~~~if:javascript
Some good reading: [MDN Docs about arrays](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)
~~~
~~~if:python
Some good reading: [Python Lists](http://www.compciv.org/guides/python/fundamentals/lists-mutability/)
~~~

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Data structures

Starter code: def without_last(lst):
	

Solutions:
def without_last(lst):
	return lst[:-1]


def without_last(lst):
	lst_copy = list(lst)
	lst_copy.pop()
	return lst_copy


def without_last(lst):
	l = lst[:]
	l.pop()
	return l


def without_last(lst):
	if len(lst) < 1:
		return lst
	return lst[:-1]


from operator import itemgetter
without_last = itemgetter(slice(0, -1))


def without_last(lst):
	new = lst[:]
	new.pop()
	return new


def without_last(lst):
	x = lst[:-1]
	return x


def without_last(lst):
	print(lst)
	return lst[0:len(lst) - 1]