On 24 Juli, 00:30, Samir <spytho...@gmai l.comwrote:
[...]
[...]
[...]
'int' object is not callable... hmmm...
Traceback (most recent call last):
File "<pyshell#2 1>", line 1, in <module>
42()
TypeError: 'int' object is not callable
Traceback (most recent call last):
File "<pyshell#2 6>", line 1, in <module>
sum(divisor)
TypeError: 'int' object is not callable
That must be it.
No debugging, just reading the error message and the code...
from math import sqrt
>
def findSumOfDiviso r(n):
>
def findSumOfDiviso r(n):
return sum(divisor) # return the sum of the
divisors
divisors
for i in range(2,10): # loop through integers 2
through 9
through 9
sum = findSumOfDiviso r(i) # then find the sum of its divisors
Traceback (most recent call last):
File "pe_prob021.py" , line 19, in <module>
sum = findSumOfDiviso r(i) # then find the sum of itsdivisors
File "pe_prob021.py" , line 12, in findSumOfDiviso r
return sum(divisor) # return the sum of the
divisors
TypeError: 'int' object is not callable
>
File "pe_prob021.py" , line 19, in <module>
sum = findSumOfDiviso r(i) # then find the sum of itsdivisors
File "pe_prob021.py" , line 12, in findSumOfDiviso r
return sum(divisor) # return the sum of the
divisors
TypeError: 'int' object is not callable
>
>>42()
File "<pyshell#2 1>", line 1, in <module>
42()
TypeError: 'int' object is not callable
>>divisor = 1
>>sum = 42
>>sum(divisor )
>>sum = 42
>>sum(divisor )
File "<pyshell#2 6>", line 1, in <module>
sum(divisor)
TypeError: 'int' object is not callable
That must be it.
No debugging, just reading the error message and the code...