Quick question.....

Irmen de Jong irmen at -NOSPAM-REMOVETHIS-xs4all.nl
Fri Jan 16 10:36:44 CET 2004


David M. Cooke wrote:
> At some point, featherstone80 at hotmail.com (Narsil) wrote:
>>NameError: global name 'sum' is not defined
>>
>>What did I do wrong?
> 
> 
> 'sum' as a builtin was introduced in python 2.3. You're using an older
> version.
> 

If you don't have sum, try:

	reduce(lambda x,y: x+y, numberlist)

instead.

--Irmen



More information about the Python-list mailing list