By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,713 Members | 1,351 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,713 IT Pros & Developers. It's quick & easy.

Re: Request Help Debugging Program

P: n/a
On Jul 23, 6:30*pm, Samir <spytho...@gmail.comwrote:
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
>>>
Jul 24 '08 #1
Share this Question
Share on Google+
1 Reply

P: n/a
On Jul 23, 9:14*pm, mzdude <jsa...@cox.netwrote:
On Jul 23, 6:30*pm, Samir <spytho...@gmail.comwrote:
Hi Everyone,
def findSumOfDivisor(n):
<snip>
* * return sum(divisor) * * * * * * * *# fine usingfunction 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.
Jul 24 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.