ExampleEdit & Run
#Using the callable() function

def func():
    print("Hello")

a = 10

print(callable(func)) #is func callable?

print(callable(a)) #is a callable?
copy
Output:
True False [Finished in 0.010328317992389202s]

The callable() function checks if an object is callable, i.e. if it is a function, a method, a lambda function, or a class. It takes a single argument and returns a boolean value (True or False).

Syntax:
callable(obj)
copy
obj The object to check whether it can be called all not.
Parameters:

The function returns a boolean value. True if the object is callable, False otherwise.

ExampleEdit & Run
def func():
   pass

print( callable(func) )

L = [1, 2, 3]
print( callable(L) )

print( callable(print) )
copy
Output:
True False True [Finished in 0.009750687051564455s]