Generate a Python program to calculate the sum of all numbers in a list and print it out.
[1, 2, 3, 4, 5]
def sum_list(l):
    result = 0
    for num in l:
        result += num
    return result

list = [1, 2, 3, 4, 5]
print(sum_list(list))