Find the best answers to your questions at Westonci.ca, where experts and enthusiasts provide accurate, reliable information. Connect with a community of experts ready to help you find accurate solutions to your questions quickly and efficiently. Experience the convenience of finding accurate answers to your questions from knowledgeable experts on our platform.

write a python program to calculate the average of the given number​

Sagot :

Answer:

The program in Python is as follows:

n = int(input())

sum = 0

for i in range(n):

   num= float(input())

   sum+=num

   

print("Average: ",sum/n)

Explanation:

Required

Average of numbers

The explanation is as follows:

This prompts the user for the count of numbers, n

n = int(input())

Initialize sum to 0

sum = 0

Iterate through n

for i in range(n):

This gets input for each number

   num= float(input())

This calculates the sum of all inputs

   sum+=num

This calculates and prints the average of all inputs

print("Average: ",sum/n)