CYBER WEEK - EXTRA SAVINGS EVENT
TRY A FREE LESSON

Functions: #1 TypeError: 'int' object is not callable

Screen Link: https://app.dataquest.io/m/315/functions%3A-fundamentals/1/functions

Your Code: a_list = [4444, 8897, 6340, 9896, 4835, 4324, 10, 6445, 661, 1246, 1000, 7429, 1376, 8121, 647, 1280, 3993, 4881, 9500, 6701, 1199, 6251, 4432, 37]
sum(a_list)

What I expected to happen: I expect to see the sum .

What actually happened: TypeErrorTraceback (most recent call last) <ipython-input-1-c2dac134335a> in <module>() 2 661, 1246, 1000, 7429, 1376, 8121, 647, 1280, 3 3993, 4881, 9500, 6701, 1199, 6251, 4432, 37]
----> 4 sum(a_list)

TypeError: 'int' object is not callable

Other details: I started with the full code solution but started stepping back to isolate the issue. i tried restarting the browser session to restart the interpreter but to no avail.

Hi @jf.dataquest!

From what you’ve posted, it’s hard to see what the problem is. Would you mind copy-pasting your code here? When I click on your link I see my own solution, not yours.

Hey.

This question as been asked in many different forms quite a few times. I suggest you take a look at other topics to try to come up with an answer.

The code pasted was the entire code.
The answer as I expected wasn’t the code but was the interpreter. My first iteration, because I hadn’t fully followed the variable naming convention, I had named my manual version of sum as sum. Once corrected the interpreter had held onto the variable even though it was no longer being used. It took starting a new browser session and waiting about 15 mins for the same code to start working. It would be nice to have an option to restart the interpreter manually. Thanks for the replies.

2 Likes

I did the same thing. Thanks for your solution!