python

Python hasattr() Function

A useful built in function in Python is hasattr(). This function is used to test if an object has some attribute. hasattr() returns True if the object you specify contains a particular attribute and False if it does not. hasattr() syntax: hasattr() takes two parameters: object. The object whose attribute you want to check attribute. …

Python hasattr() Function Read More »