• 2021-04-14
    以下代码,要求通过调用函数mean计算出列表元素的平均值,并输出。请完善代码。‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬
    def mean(numlist):
    s = 0.0
    for num in numlist:
    s = s + num
    return s/len(numlist)
    ls = [11,43,23,37,61,29]
    print("平均值为:",【 】)