THE WORLD'S LARGEST WEB DEVELOPER SITE

Python callable() Function

❮ Built-in Functions


Example

Check if a function is callable:

def x():
  a = 5

print(callable(x))
Run example »

Definition and Usage

The callable() function returns True if the specified object is callable, otherwise it returns False.


Syntax

callable(object)

Parameter Values

Parameter Description
object The object you want to test if it is callable or not.

More Examples

Example

A normal variable is not callable:

x = 5

print(callable(x))
Run example »

❮ Built-in Functions