getattr It returns the value of the named attribute of an object. getattr(object, name) class Person: age = 23 name = "Adam" person = Person() getattr(person, 'age') >>> 23 When the named attribute is not found, default value is returned. getattr(object, name, default) class Person: age = 23 name = "Adam" person = Person() getattr(person, 'gender','unknown') >>> unknown The named attribute gende..