Function To Find the Average of All Numbers in List || Type 2 || Functions || Python

 

In this we are going to see how to build a function to to Find the Average of All Numbers in List - Type 2 of Functions in Python Programming Language.

def avg(list):

    sum = 0
    for i in list:
        sum = sum + i
    avg = sum / len(list)
    print(avg)


avg([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
# Coded By Ashish

#ENJOY CODING


Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post