how to check an object attribute in python exists code example Example: python check if has attribute if hasattr(a, 'property'): a.property