Skip to content

Commit 4aeba3c

Browse files
authored
Average.py
I have added a python program to calculate average of n numbers inserted by user. Average code file was not there in reposatory so I created one. Kindly have a look and add hacktober fest tag to it.
1 parent 9629aef commit 4aeba3c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Average.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
n=int(input("Enter the number of elements to be inserted: "))
2+
a=[]
3+
for i in range(0,n):
4+
elem=int(input("Enter element: "))
5+
a.append(elem)
6+
avg=sum(a)/n
7+
print("Average of elements in the list",round(avg,2))

0 commit comments

Comments
 (0)