Create a function in Python that sorts the elements of a given list.
[5, 7, 2, 3, 4, 1]
def sort_list(numbers):
    numbers.sort()
    return numbers

result = sort_list([5, 7, 2, 3, 4, 1])
print(result)