(continued from previous page def __del__(self)student totalstudent - print("total students (del"self totalstudent def main() student("meher"total students (init student("krishna"total students (init student("patel"total students (init #delete object del total students (del print( nameerror because object is deleted print( namekrishna print( namepatel #since there is no further statementstherefore #'delwill be executed for all the objects and #following results will be displayed total students (deltotal students (del standard boilerplate to set 'mainas starting function if __name__=='__main__'main( __str__ when __str__ is defined in the classthen 'printstatement for object ( print(jat line of listing )will execute the __str__ statementinstead of printing the address of objectas happened in listing this statement is very useful for providing the useful information about the class using print statement listing __str__ method is executed when 'printstatement is used for object #strex py #class declaration class jungledef __str__(self)return("it is an object of class jungle" def main()create object of class jungle jungle(print(jit is an object of class jungle standard boilerplate to set 'mainas starting function if __name__=='__main__'main( __call__ the __call__ method is executedwhen object is used as functionas shown in line of listing where object 'dis used as function ( object oriented programming