Hasattr() is a built-in Python function that checks whether an object or class has a specific attribute. It returns a boolean value - True if the attribute exists and False if it doesn't.