The hasattr() function returns True if the specified object has the specified attribute, otherwise False .
hasattr(object, name)