Write a function in Python to find the sum of all elements of a given list.
inputList = [1, 2, 3, 4, 5]
def sum_list(inputList): 
    sum_list = 0
    for num in inputList: 
        sum_list += num 
    return sum_list