On Wed, May 19, 2010 at 4:25 PM, superpollo <ute...@esempio.net> wrote: > Jerry Hill ha scritto: >> sumofdigits = sum(int(char) for char in str(testval)) > > this line gives me this: > > TypeError: 'int' object is not callable > > is it some new feature in >2.5 ?
No, sum() has been a builtin since Python 2.3. Based on your first post, you have probably shadowed the builtin "sum" function by assigning an integer to a variable named "sum". -- Jerry -- http://mail.python.org/mailman/listinfo/python-list