The program takes the elements of the list one by one and displays the average of the elements of the list.
Here is source code of the Python Program to Find the Average of Numbers in a Given List. The program output is also shown below.
Python Code:
1 2 3 4 5 6 7 8 9 | n=int(input("Enter the number of elements to be inserted: ")) a=[] for i in range(0,n): elem=int(input("Enter element: ")) a.append(elem) avg=sum(a)/n print("Average of elements in the list",round(avg,2)) |
Output: