Optimize the python code that finds the sum of the elements in a given array.
def sum(arr): 
    s = 0
    for i in range(len(arr)): 
        s += arr[i] 
    return s
def sum(arr): 
    s = 0
    for number in arr: 
        s += number 
    return s