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.
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)
Comments
Leave a comment