Home / Python / Reference / Built-in functions

Python callable() function

Check whether something can be called like a function.

Syntax

callable(obj)

True for functions, classes, methods and objects with a __call__ method.

Parameters

objany value

Return value

bool

Example

Code

print(callable(print), callable(len), callable(42), callable(str))

Output

True True False True

Related

Learn it step by step in the free lesson More Functions, with exercises that check your answers.