#!/usr/local/bin/python
# calcula a média de números


#loop = True
#while loop:
#    try:
#        numbers = raw_input('What numbers should I average? ')
#        numbers = numbers.split(' ')
#        total = 0.0
#        for number in numbers:
#            total += int(number)
#        print 'The average is ' + str(total / len(numbers)) + '.'
#        raw_input('Press enter to quit.')
#        loop = False
#    except:
#        print 'Error: I can only take numbers!'

#!/usr/bin/env python
# # -*- coding: UTF-8 -*-
# Criado em:Qua 22/Abr/2009 hs 15:06
# Last Change: Qua 22/Abr/2009 hs 15:06
# vim:ft=python:nolist:nu:
# Instituicao: none
# Proposito do script: calcular média
# Autor: Sérgio Luiz Araújo Silva 
# site: http://vivaotux.blogspot.com 

##############################
# outra forma pronta
#def media(*valores):
#      total=0.0
#      for x in valores: 
#          total+=x
#      return total/len(valores)
##################################

def main():
    while True:
        try:
            numbers = raw_input('What numbers do you want averaged? ').split()
            print 'The average is', average([int(number) for number in numbers])
            raw_input('Press enter to quit.')
            return
        except:
            print 'not here.'

def average(numbers):
    return sum(numbers) / len(numbers)

if __name__ == '__main__':
    main()