Write Python. Understand every error.

Open the editor

Error guide · TypeError

TypeError: 'int' object is not callable

You put brackets after something that is not a function, so Python tried to call it and could not.

Example

sum = 10
numbers = [1, 2, 3]
print(sum(numbers))

What Python says

TypeError: 'int' object is not callable

As printed by Python 3.12. Other versions may word it slightly differently.

Try this code in Py-CRAFT

Why it happens

Names such as sum, max, len and list belong to built-in functions. When you use one of them as a variable name, your value hides the function. After that, sum(numbers) tries to call the number 10, which fails. The same error appears when a missing operator leaves brackets right after a value, as in 2(3).

How to fix it

total = 10
numbers = [1, 2, 3]
print(sum(numbers))

Output: 6

Tips

Learn the ideas behind it

Other common errors

Share this page: