Answers for "avg function python"

12

average value of list elements in python

# Example to find average of list
number_list = [45, 34, 10, 36, 12, 6, 80]
avg = sum(number_list)/len(number_list)
print("The average is ", round(avg,2))
Posted by: Guest on February-14-2020
5

python average

def avrg(values): # where values is a list of all values
  return sum(values)/len(values)
Posted by: Guest on March-27-2021
0

python avg

my_list = [1,2,3,4]

import numpy as np
print("mean = ", np.mean(my_list))
Posted by: Guest on March-19-2021

Python Answers by Framework

Browse Popular Code Answers by Language