Request Help Debugging Program

Samir spython01 at gmail.com
Wed Jul 23 21:30:11 EDT 2008


On Jul 23, 9:14 pm, mzdude <jsa... at cox.net> wrote:
> On Jul 23, 6:30 pm, Samir <spytho... at gmail.com> wrote:
>
> > Hi Everyone,
>
> > def findSumOfDivisor(n):
> <snip>
> >     return sum(divisor)                # fine using function sum()
>
> >         sum = findSumOfDivisor(i)      # then find the sum of its divisors
>
> oops redefine what sum is.
>
>
>
> >>> x = [1,2]
> >>> sum(x)
> 3
> >>> sum = 4
> >>> sum(x)
>
> Traceback (most recent call last):
>   File "<pyshell#11>", line 1, in <module>
>     sum(x)
> TypeError: 'int' object is not callable
>
>
>
> - Hide quoted text -
>
> - Show quoted text -

I am an IDIOT!  Thanks, mzdude!  That did the trick.
Sorry for posting something this stupid.



More information about the Python-list mailing list