# # This program finds the average of the inputed numbers. # Uses sentinel approach. # A sentinel here is an empty string # def main(): print "This program finds the average of inputed numbers" sum_=0 counter=0 ns='0' while ns != "": sum_=sum_+eval(ns) counter=counter+1 ns=raw_input("Please, input a number (press to stop):") average=float(sum_)/(counter-1) print "The average of the inputed numbers is %0.2f" % average main()