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

what are the examples of non viscous liquid​
Write a sentence to compare the two points shown on the number line.
A) 67° B) 98° C) 80° D) 69°
Evaluate the logarithmic function for the given value. f(x) = log5 x for f(125) f(125)=( HELP!
WILL MARK BRAINLIEST!!!! Federal judges are confirmed by a Supreme Court justice the President the Senate the House of Representatives
The domain of f(x)=cosx must be restricted to all real numbers in order for the function to have an inverse function. The domain of g(x)=arccos(x) is −1≤x≤1
free pts enjoy s//h/a/w/t/a/yyyy !!! <3 have a good day! (✿◠‿◠)
In a market economy, which of the following is MOST LIKELY to benefit consumers? A a decrease in the supply of a product B a rise in interest rates С industrial
HELP ASAP PLZ PLZ HELP ME PLZ HELP MEEEE
Evaluate the expression 21x, if x= 4.