Thursday, 14 May 2015

Python program to find average of N numbers



This is a Python program  to find average of N  numbers.
Generally average  is calculated as the sum of all the numbers divided by total numbers.

Average = (n1+n1+.........)/N

PROGRAM :
num = int(input('How many numbers: '))
sum = 0
for n in range(num):
    numbers = int(input('Enter number '))
    sum = sum + numbers

avg = sum/num
print('Average of ', num , 'numbers is :',avg)



OUTPUT  : 
Python - Average of N numbers



Similar Programs :
C program to find average of N numbers
Cpp program to find average of N numbers
Java program to find average of N numbers