Question #243493

Average of Given Numbers

You are given space-separated integers as input. Write a program to print the average of the given numbers.

Input

The first line of input contains space-separated integers.

Output

The output should be a float value rounded up to two decimal places.

Explanation

In the example, input is 

1, 0, 2, 5, 9, 8. The sum of all numbers present in the list is 25, and their average is 25/6.

So, the output should be 

4.17.

Sample Input 1
1 0 2 5 9 8
Sample Output 1
4.17
Sample Input 2
1 2 3 4 5
Sample Output 2
3.0

input should be single line

Expert's answer

n=int(input("Enter the number of elements to be inserted: "))


a = [int(i) for i in input().split()][:n]
avg=sum(a)/n
print("Average of elements in the list", round (avg, 2))
LATEST TUTORIALS
APPROVED BY CLIENTS