You can use the isinstance built-in to check if the type of a variable conforms to a type of a function. Unfortunately, as there is no short hand to create a function type just like int
you can import types and check with types.FunctionType
>>> import types
>>> isinstance(add, types.FunctionType)
True
you can also import isfunction from inspect to perform the same check
import inspect
inspect.isfunction(add)