Write a valid Python program that takes a list and outputs the sum of the elements.
[1, 2, 3]
def sumListElements(arr):
    sum = 0
    for num in arr:
        sum += num
    return sum

result = sumListElements([1,2,3]) 
print(result)