Write a function called average with input N average N to ca

Write a function called average with input N: average (N) to calculate (and return) the average of N numbers Try your program with the following numbers 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110

Solution

def average():
       avg = 0
       sum = 0
       for n in numbers:
       n = int(input(\"enter numbers to calculate average: \"))
       sum = sum + n
       avg = sum / len(numbers)
  
return avg

print (\"The average is: \")
print (avg)

average()

 Write a function called average with input N: average (N) to calculate (and return) the average of N numbers Try your program with the following numbers 60, 65

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site