Python callable() Function

❮ Built-in Functions


Example

Check if a function is callable:

def x():
  a = 5

print(callable(x))
Try it Yourself »

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))
Try it Yourself »

❮ Built-in Functions

Copyright 1999-2023 by Refsnes Data. All Rights Reserved.