Python callable() Function
The callable() function returns a boolean value ‘True’ if the specified object is callable, else it returns False.
Syntax
1 2 3 |
callable(object) |
Parameter
Object: The object parameter represents the value to test if it is callable or not.
Return
This function returns a returns Boolean value true, if the given object is callable.
Example 1
1 2 3 4 5 6 7 8 9 10 11 |
# Python program explaining # callable() function def call(): return 5 # an object is created of call() val = call print('callable() function will return: ',callable(val)) num = 15 * 15 print('callable() function will return: ',callable(num)) |
Return
1 2 3 4 |
callable() function will return: True callable() function will return: False |