Python callable() Function

Example

Check if the function is callable:

def x():
  a = 7
print(callable(x))

Run Instance

Definition and Usage

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

Syntax

callable(object)

Parameter Value

Parameter Description
object Need to test whether the object is callable.

More Examples

Example

Normal variables are not callable:

x = 7
print(callable(x))

Run Instance