(continued from previous pagecompare( types of objects are same compare(xyobjects have same id values of objects are same types of objects are same id( id( isinstance notethe type of an object is itself an objectwhich is known as object' class this object ( object' classis unique for given typehence can be compared using 'isopeartor as shown belowx [ [ if type(xis listx append(yx [ [ ]above operation can be performed using isinstance(objecttypeas shown belowx [ [ if isinstance(xlist) append(yx [ [ ] reference count and garbage collection all the objects are reference counted this reference count is increased whenever new name is assigned to object or placed in container listtuple or dictionary etc getrefcount getrefcount can be used to see the reference count of an object import sys sys getrefcount( (continues on next page reference count and garbage collection