def mean(arr):
    """Calculate the mean of a given array of numbers.

    :param arr: An array of numbers
    :return: The mean of the array
    """
    total = 0

    for num in arr:
        total += num

    mean = total / len(arr)
    return mean

print(mean([1, 4, 8, 13, 28, 34])) # The mean is 14.833333333333334. The output is accurate.
[1, 4, 8, 13, 28, 34]
Calcolare la media di una data matrice di numeri.