listing __call__ method is executed when object is used as function callex py #class declaration class calculatepricediscount in def __init__(selfdiscount)self discount discount def __call__(selfprice)discountprice price price*self discount/ return (pricediscountprice def main()create object of class calculateprice with discount calculateprice( using object as function ( since two variables are return by call fuctiontherefore unpack the return values in two variables pricepriceafterdiscount ( print("original price% price after discount % (pricepriceafterdiscount) #or use below methodif you do not want to unpack the return values getprices ( print("original price%sprice after discount % (getprices[ ]getprices[ ]) standard boilerplate to set 'mainas starting function if __name__=='__main__'main( __dict__ and __doc__ __dict__ is used to get the useful information about the class (line )whereas __doc__ prints the docstring of the class (line listing __dict__ and __doc__ #dictex py #class declaration class jungle""list of animal and pet information animal string ispet string ""def __init__(selfanimal="elephant"ispet="yes")self animal animal self ispet ispet def main()create object of class jungle jungle(print( __dict__{'ispet''yes''animal''elephant' jungle("lion""no"(continues on next page object oriented programming