Function to Find the Sum and Average of all Numbers in List || Type 4 || Functions || Python

 
In this we are going to see a basic example to Find the Sum and Average of all Numbers in List - Type 4 of Functions in Python Programming Language.

def sum_avg(list):
    sum = 0
    for i in list:
        sum = sum + i
    avg = sum / len(list)
    return sum, avg


x = sum_avg([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
print("Sum : ", x[0])
print("Average : ", x[1])

# Coded By DHIRAJ SHELKE

#ENJOY CODING


Post a Comment

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

Previous Post Next Post