Definition
The callable() function returns True
if the specified object is callable, otherwise it returns False
.
Syntax
callable(object)
Parameters
Parameter | Description |
---|---|
object | The object you want to test if it is callable or not. |
Example
def myFunction():
myvar = 52
print(callable(myFunction))
# normal variables are not callable
myvar2 = 23
print(callable(myvar2))