You run your script. Python stops and prints this:

TypeError: 'int' object is not callable 

It's a strange message. You probably never tried to "call" a number. Below you'll see what it means, the six situations that trigger it in real programs, and the fix for each one. I ran every example on Python 3.11, 3.12 and 3.14. All three print the same error.

What the Error Means

Calling something means putting parentheses after it, like print(x), len(items) or score(3, 4). You can call functions, methods and classes. You can't call a number. So when Python hits something(...) and something holds an integer right now, it raises TypeError: 'int' object is not callable. The word in quotes is the type of the thing you tried to call. That's why you may also see 'str' object is not callable, 'list' object is not callable, 'float' object is not callable or 'NoneType' object is not callable. The causes below apply to all of them.

The causes fall into two families. Most of the time, a name that used to be a function got overwritten by a number (causes 1, 2, 4 and 6). The rest happen when you typed parentheses where none belong (causes 3 and 5).

How to Find the Cause Fast

Start with the traceback. It points at the line with the call. Look at the name right before the parentheses and ask what it holds right now. Print it, or ask Python:

print(type(sum), sum) # <class 'int'> 0 means sum was overwritten print(callable(sum)) # False means it cannot be called 

callable() is a built-in. It gives True for functions and classes, and False for numbers, strings and lists. If the name holds a number, search your file for the earlier line that assigned it. Can't find one? And the parentheses sit after a number or a closing bracket? Then you're looking at cause 3 or 5.

The Six Causes

1. A Variable Has the Name of a Built-in

sum = 0 # this hides Python's built-in sum() for n in [1, 2, 3]: sum += n print(sum([4, 5, 6])) # TypeError: 'int' object is not callable 

Python ships with dozens of built-in names: sum, max, min, len, list, str, input, id and type are a few. If you assign to one, you create your own variable with that name, and yours wins from then on. The built-in isn't gone. It's just hidden. Pick a descriptive name like total instead:

total = 0 # pick a name that is not a built-in for n in [1, 2, 3]: total += n print(total) print(sum([4, 5, 6])) # the built-in still works 

Already overwrote a built-in in an interactive session? Run del sum and your variable goes away, so the built-in shows up again (I tested this). In a script, just rename the variable.

2. A Function Was Replaced by Its Own Result

def score(a, b): return a * b score = score(3, 4) # score is now the number 12, not the function print(score(5, 6)) # TypeError: 'int' object is not callable 

score = score(3, 4) looks innocent. It runs the function and keeps the answer. But the answer goes into the same name as the function, so the function disappears. The second call fails because score is now 12. In a long file it's easy to miss. It often happens when you paste code twice or run a notebook cell twice. Keep the result under a new name:

def score(a, b): return a * b first = score(3, 4) # store the result under a different name print(first) print(score(5, 6)) 

3. A Missing Operator Before Parentheses

a = 5 b = 3 result = 2 (a + b) # the * is missing: Python tries to call 2 print(result) # TypeError: 'int' object is not callable 

In maths, 2(a + b) means two times the sum. Python reads it as "call the number 2 with the argument a + b". The same thing happens with )( between two brackets, like (a + b)(c + d). On the Python versions I tested (3.11 to 3.14), you get a hint before the error: SyntaxWarning: 'int' object is not callable; perhaps you missed a comma?. Spell the operator out:

a = 5 b = 3 result = 2 * (a + b) print(result) 

4. An Attribute and a Method With the Same Name

class Cart: def __init__(self): self.count = 0 # an attribute... def count(self): # ...and a method with the same name: the attribute wins return self.count cart = Cart() print(cart.count()) # TypeError: 'int' object is not callable 

Look at self.count = 0. It stores a number on the object. That instance attribute beats the method count you defined with def, so cart.count() ends up calling the number. This is the classic form of the error in object-oriented code. The fix is to give data and behaviour different names. Many people use nouns for attributes (items) and verbs or get_ names for methods (count_items):

class Cart: def __init__(self): self.items = 0 # data gets one name def count(self): # the method gets another return self.items cart = Cart() print(cart.count()) 

5. Calling the Result of a Call

def total(): return 10 print(total()()) # total() is 10; the second () tries to call 10 

total() runs the function and hands back 10. A second () then tries to call 10. Usually it's a double paste. Or you wrapped a call in a function that you thought returned another function. Delete the extra pair:

def total(): return 10 print(total()) # one pair of parentheses is enough 

6. A Loop Variable That Hides a Function

for len in range(3): # len now means 0, 1, 2 pass print(len("hello")) # TypeError: 'int' object is not callable 

This is cause 1 in disguise. It's the hardest one to spot, because the overwrite happens in the loop header. A for loop assigns to its variable, so for len in range(3) turns len into a number. The same goes for for str in ..., for input in ... and with open(...) as list. Use plain names like i, item or row:

for i in range(3): # use a normal loop variable pass print(len("hello")) 

How to Stop It From Happening Again

Never use a built-in as a variable name. The usual suspects are list, dict, str, sum, max, min, len, input, id, type, file, next and format. If the obvious name is taken, add a word. Try total, items, text or maximum.

Let a linter catch it. Pylint reports redefined-builtin, and flake8 plugins flag the same thing. You usually get a yellow underline in your editor before you run anything. Many editors can run one for you.

Restart after renaming in a notebook. In Jupyter or the Python shell, an overwritten name stays overwritten. Fixing the code doesn't change that. You have to restart the kernel or delete the variable. So if a fixed program still fails there, restart and run it again from the top.

Quick Reference

What you see Likely cause Fix
Error on a built-in such as sum(...) or len(...) A variable has the same name Rename the variable
Error on your own function after using it once f = f(...) replaced the function Store the result under a new name
Error on 2 (a + b) or )( A missing operator Add * or +
Error on obj.name() An attribute and a method share a name Rename one of them
Error on f()() A second pair of parentheses Remove it
Error after a for loop The loop variable has a built-in name Use i or item

The Rule, Stated Once

'int' object is not callable means a name you're using like a function holds a number. Print the name's type. Find the line that assigned it. Rename the variable. No assignment anywhere? Then hunt for a missing operator or an extra pair of parentheses. And keep built-in names out of your own variables. A linter will warn you before the error ever shows up.

Want more Python errors with a clear cause? Try RecursionError, FileNotFoundError, TypeError: NoneType Is Not Subscriptable and UnboundLocalError. New to Python? Start with Python for Beginners.

Download the code: the broken and fixed versions of all six causes are on GitHub in Python-projects/Troubleshooting/typeerror-not-callable. Run any file with python bug.py from inside its folder.