📜  calcutalte average python 代码示例

📅  最后修改于: 2022-03-11 14:46:54.334000             🧑  作者: 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]))