# # This program finds the average of the inputed numbers. # Uses sentinel approach # # def main(): print "This program finds the average of inputed numbers" sum_=0 counter=0 next_value=0 while next_value != -1000: sum_=sum_+next_value counter=counter+1 next_value=input("Please, input a number (input -1000 if you want to stop):") average=float(sum_)/(counter-1) print "The average of the inputed numbers is %0.2f" % average main()