To find the average of list in Python, use one of the following two ways.

  1. Use the sum() and len() functions. Divide the sum() by the len() of a list of numbers to find the average.
  2. Use statistics.mean() function to calculate the average of list in Python.
  3. Using Python for loop.
  4. Using Python numpy.mean().

Python mean() is an inbuilt statistics module function that used to calculate the average of numbers and list. The mean() function can be used to calculate the mean/average of the given list of numbers. It returns the mean of the data set passed as parameters. Python is a popular language when it comes to data analysis and statistics.

The formula to calculate the average is achieved by calculating the sum of the numbers in the list divided by a count of numbers in the list.

Python 3 provides the statistics module, which comes with very useful functions like mean(),  median(),  mode(), etc.

#python #python 3 #python average

Python Average: Python mean() Function Example
5.55 GEEK