How to Fix: TypeError: ‘list’ object is not callable

3D illustration of a robot trying to press a play button on a storage crate, representing the list not callable error.

This TypeError list not callable means: “You are trying to use a list as if it were a function.”

A “callable” is anything you can put parentheses () after, like print() or my_function(). A list, like [1, 2, 3], is just a container for data.

Cause 1: Accidental Parentheses (The Typo)

You meant to use square brackets [] to get an item, but you typed parentheses () instead.

Problem Code:

my_list = [10, 20, 30]
print(my_list(0)) # CRASH!
# Python thinks you are trying to "call" the list

The Fix: Use square brackets [] to access items by their index.

my_list = [10, 20, 30]
print(my_list[0]) # Correct! Output: 10

Cause 2: Overwriting a Built-in Function (The Real Culprit)

This is the most common and confusing cause. You created a variable and accidentally named it list.

Problem Code:

# This line is the problem!
# You overwrite the built-in list() function
list = [1, 2, 3]

# ... later in your code ...

# You try to use the *real* list() function
# to convert a tuple into a list
my_tuple = (4, 5, 6)
new_list = list(my_tuple)
# CRASH! TypeError: 'list' object ([1, 2, 3]) is not callable

The Fix: NEVER use built-in function names as variable names. Rename your list variable to something safe, like my_list.

my_list = [1, 2, 3] # Safe!

my_tuple = (4, 5, 6)
new_list = list(my_tuple) # Works perfectly

Other names to avoid: sum, str, dict, int, min, max.

Similar Posts

Leave a Reply