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/)
~~~

Difficulty: introductory

Starter code:

def without_last(lst):
	

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

def without_last(lst):
    lst_copy = list(lst) # creates a shallow copy
    lst_copy.pop()
    return lst_copy

# There are several other ways to solve this
# like returning lst[:-1] directly or creating a new list iteratively with all the elements of lst minus the last one 


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):
    # Fix it
    x = lst[0:-1]
    return x

def without_last(lst):
#     # Fix it
#     lst.pop() # removes the last element
#     return lst
    return lst[:-1]

def without_last(lst):
    print(lst)
    #print(lst.pop()) # removes the last element
    return lst[0:len(lst)-1]