📜  在 python 代码示例上取平均值

📅  最后修改于: 2022-03-11 14:46:39.375000             🧑  作者: Mango

代码示例1
# app.py

def averageOfList(num):
    sumOfNumbers = 0
    for t in num:
        sumOfNumbers = sumOfNumbers + t

    avg = sumOfNumbers / len(num)
    return avg


print("The average of List is", averageOfList([19, 21, 46, 11, 18]))