Create Python code to sum all the values in a list?
[1,2,3,4,5]
def sum_list(l):
    '''This function returns the sum of all the values in a list'''
    sum = 0
    for val in l:
        sum = sum + val
    return sum