Question #281758

Maria has 4 bags while going to airport, she has been told that she can take an average of 50kg.Tell her to input the weights of each bag and calculate the mean weight.

Expert's answer

num = int(input('How many bags: '))
total_sum = 0
for n in range(num):
    numbers = float(input('Enter the weights of bags in kg : '))
    total_sum += numbers
avg = total_sum/num
print(' Average weight is :', avg)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS