emp displayemployee(print "total employee %demployee empcount when the above code is executedit produces the following resultname zara ,salary name manni ,salary total employee you can addremove or modify attributes of classes and objects at any timeemp age emp age del emp age add an 'ageattribute modify 'ageattribute delete 'ageattribute instead of using the normal statements to access attributesyou can use following functionst he etattr(objname[default]to access the attribute of object he hasattr(obj,nameto check if an attribute exists or not he setattr(obj,name,valueto set an attribute if attribute does not existthen it would be created he delattr(objnameto delete an attribute hasattr(emp 'age'returns true if 'ageattribute exists getattr(emp 'age'returns value of 'ageattribute setattr(emp 'age' set attribute 'ageat delattr(empl'age'delete attribute 'agebuilt-in class attributesevery python class keeps following built-in attributes and they can be accessed using dot operator like any other attribute__dic t__ dictionary containing the class' namespace __doc __ class documentation string or none if undefined __name__class name __module__module name in which the class is defined his attribute is "__main__in interactive mode __bases__ possibly empty tuple containing the base classesin the order of their occurrence in the base class list for the above class let' try to access all these attributes#!/usr/bin/python class employee'common base class for all employeesempcount def __init__(selfnamesalary)self name name self salary salary employee empcount + def displaycount(self)print "total employee %demployee empcount def displayemployee(self)print "name "self name"salary"self salary