Write Python code to find the sum of products of respective array elements
[1, 2, 3, 4]
[5, 10, 15, 20]
def sum_product_array(arr1, arr2):
    total = 0
    for i in range(len(arr1)):
        total += arr1[i] * arr2[i]
    return total