
December 21st, 2012, 02:09 PM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 3
Time spent in forums: 28 m 46 sec
Reputation Power: 0
|
|
|
Trouble using the sum function..
This is my code:
x = [1,2,3,4,5,6,7,8,9]
total = sum(x)
print total
This is my error report:
Traceback (most recent call last):
File "python", line 3, in <module>
TypeError: 'int' object is not callable
I want to simply take the sum of the items in my list named x by using the sum function. What am I doing wrong and a correct way to do this would be appreciated.
|