summ = 0 count = 1 while raw_input("Enter q to quit or any other key to continue") != 'q': summ = summ+input() count=count+1 print summ/(count*1.0)