Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

average python

def cal_average(num):
    sum_num = 0
    for t in num:
        sum_num = sum_num + t           

    avg = sum_num / len(num)
    return avg

print("The average is", cal_average([18,25,3,41,5]))
Source by www.guru99.com #
 
PREVIOUS NEXT
Tagged: #average #python
ADD COMMENT
Topic
Name
8+5 =