Skip to content

Commit 492959f

Browse files
authored
Average in python
Find average of a list in python
1 parent 99cf7d7 commit 492959f

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

‎Find average of a list in python‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Python program to get average of a list
2+
3+
def Average(lst):
4+
5+
return sum(lst) / len(lst)
6+
7+
8+
# Driver Code
9+
10+
lst = [15, 9, 55, 41, 35, 20, 62, 49]
11+
12+
average = Average(lst)
13+
14+
15+
# Printing average of the list
16+
17+
print("Average of the list =", round(average, 2))

0 commit comments

Comments
 (0)