TypeError not callable 🐍 Python

TypeError: 'str' object is not callable

You used parentheses on something that isn’t a function — often a variable shadowing a built-in.

Seen on: Python

Meaning

Naming a variable list, str, dict, input or sum replaces the built-in, so a later list(...) calls your variable. Missing commas or operators (2(3)) cause it too.

Common causes

  • Variable named like a built-in (list = [...], str = "...")
  • Property accessed with ()
  • Missing * or , in an expression
  • Module imported instead of a function inside it

⚡ Quick fix

  1. Rename the variable that shadows the built-in
  2. Remove the () when accessing a property
  3. Import the function: from module import function

Detailed fix by platform

Python

  1. del list in an interactive session restores the built-in after shadowing it

How to diagnose

  1. Name — Which name is being called?
  2. Shadowing — Was it reassigned earlier?

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.