Python is a highly readable, less syntactic, interactive, object-oriented, interpreted, and high-level programming language. Python uses English terms instead of punctuation.

Some of the features of Python are mentioned below -

- It can be used for production-ready applications or rapid prototyping as well.
- It can handle complex computations and big data.
- It uses simpler syntax and can be used to write complex codes in a shorter and simpler way.
- Designed for readability and provides scope. It mainly relies on whitespace, indentation, etc.

In this article, we will discuss how to find the average of numbers present in the list in Python using the Average function in Python.

## Python Average

To find the average of given numbers in a list, we use the Python Average function. Average in Python is usually calculated by adding all the numbers in a list and then dividing it by the number of elements in this list.

There are multiple ways to find the average of a List in Python, and two of the main ways are mentioned below:

1) Python Average: Len() and Sum()

2) Python Average: statistics.mean()

### 1) Python Average: Len() and Sum()

The Sum() and Len() functions are built-in in Python and are used to find the averages.Â

This method of finding the average helps avoid looping through the list and hence is time and effort-saving. This also reduces redundancy and helps maintain DRY code since it helps in finding the average of a list using a single line.

#### Example 1

numbers = [30, 55, 3, 10, 2]

average = sum(numbers)/len(numbers)

print("Average of list: ", round(average,3))

#### Output

Average of the list:Â 20.0

#### Example 2

num_list = [1, 999, 2, 1023, 223, 876, 32]

average = sum(num_list)/len(num_list)

print("Average of list: ", round(average,2))

#### Output

Average of the list:Â 450.86

#### Example 3Â

numbers = [3098, 5565, 323, 1120, 2342, 75664]

average = sum(numbers)/len(numbers)

print("Average of list: ", round(average,1))

#### Output

Average of the list:Â 14685.3

#### Example 4Â

numbers = [3, 55986365, 564323, 1314320, 72325342, 7534265664]

average = sum(numbers)/len(numbers)

print("Average of list: ", round(average,4))

#### Output

Average of the list:Â 1277409336.1667

### 2) Python Average: statistics.mean()

To easily calculate the python average of a list, we can use the statistics moduleâ€™s mean() function. The following examples demonstrate the same.

#### Example 1Â

from statistics import mean

num_list = [30, 55, 3, 10, 2]

average = mean(num_list)

print("Average: ", round(average,3))

#### Output

Average:Â 20

#### Example 2Â

from statistics import mean

numbers = [1, 999, 2, 1023, 223, 876, 32]

average = mean(numbers)

print("Average: ", round(average,3))

#### Output

Average:Â 450.857

#### Example 3Â

from statistics import mean

num_list = [3098, 5565, 323, 1120, 2342, 75664]

average = mean(num_list)

print("Average of list: ", round(average,1))

#### Output

Average of the list:Â 14685.3

#### Example 4Â

from statistics import mean

num_list = [3, 55986365, 564323, 1314320, 72325342, 7534265664]

average = mean(num_list)

print("Average of list: ", round(average,4))

#### Output

Average of the list: 1277409336.1667

Looking forward to make a move to programming? Take up theÂ Python Training CourseÂ and begin your career as a professional Python programmer.

## Master Python With Simplilearn!

To find the average of the numbers in a list in Python, we have multiple ways. The two main ways are using the Len() and Sum() in-built function and using the mean() function from the statistics module. In order to grasp Python concepts and dive deep into python development, we must consider resources that give us a complete insight into the topics with examples, activities, and exercises.Â

Simplilearn provides such a comprehensive course through its Python Development Training program; you can check it out to get started with your Python journey!