Answers for "Given a list A of n integers, how will you calculate the average of n integers in list A in single line."

1

make averages on python

# 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]))
Posted by: Guest on April-14-2020

Code answers related to "Given a list A of n integers, how will you calculate the average of n integers in list A in single line."

Python Answers by Framework

Browse Popular Code Answers by Language