Write a function to calculate the mean of an array


Topic: Write a function to calculate the mean of an array

Solution

def calc_mean(arr):
    sum = 0
    for i in range(len(arr)):
        sum += arr[i]
    return sum / len(arr)



List all Python Programs