sartajs12082002 sartajs12082002
  • 04-06-2021
  • Computers and Technology
contestada

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

Respuesta :

MrRoyal
MrRoyal MrRoyal
  • 09-06-2021

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)

Answer Link

Otras preguntas

“Una gota de sangre” Ángela Hernández Núñez análisis literario
What describes earth’s magnetic flow
what treatment can help cure lymphomia? and what are the symtoms of these treatments
Whats the overall goal of good time management
Instruction: Answer the questions below. 1. Which of the following is most apt to increase body temperature? a. Dilation of the blood vessels in the skin b. Shi
A pair of sneakers is on sale for $51.25. If the original price of the sneakers is $62.50, what is the percent of the discount
Which of the following is correct ? Quoting is the using the author’s actual words
The length of an arc of a circle is 12 cm. The corresponding sector area is 108 cm². Find: a) the radius of the circle b) the angle subtended at the centre of t
What is the definition of executes?
edificios más antiguos del Nuevo Mundo