python check attribute of object code example
Example 1: python check if has attribute
if hasattr(a, 'property'):
a.property
Example 2: python get attributes of object
getattr(object, 'attribute_name')
if hasattr(a, 'property'):
a.property
getattr(object, 'attribute_name')