You are here : python_3Built-in Functionshasattr

hasattr() - Built-in Functions

The arguments are an object and a string.  The result is True if the
string is the name of one of the object’s attributes, False if not. (This
is implemented by calling getattr(object, name) and seeing whether it
raises an AttributeError or not.)


Syntax

hasattr(object, name)


Example


Output / Return Value


Limitations


Alternatives / See Also


Reference