# Program to calculate the average and std dev
# using a function call. Returns two values.
# our function 'avg' is defined here
def avg(nums):
sum = 0.0
sum1 = 0.0
for i in range(len(nums)):
sum = sum + nums[i]
sum1 = sum1 + nums[i]**2
average = sum/len(nums)
sd = sqrt( sum1/len(nums) )
return average, sd
# Main program begins here.
nums = [8.2, 4.5, 7.3, 7, 56.0, 7.9, 100.4]
mean, sd = avg( nums )
print("The mean is : ", mean)
print("The standard deviation is : ", sd)