C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Python callable() FunctionA python callable() function in Python is something that can be called. This built-in function checks and returns True if the object passed appears to be callable, otherwise False. Signaturecallable(object) Parametersobject - The object that you want to test and check, it is callable or not. ReturnReturns True if the object is callable, otherwise False. Let's see some examples of callable() function. Python callable() Function Example 1Check if a function is callable: def x(): a = 5 print(callable(x)) Output: True Python callable() Function Example 2Check if a function is not callable (such as normal variable). x = 5 print(callable(x)) Output: False
Next TopicPython Built in Functions
|