classes and object-oriented programming subclass can add new attributes to the instances by defining its own version of _init_ (for examplethis version of evilaccount adds new attribute evilfactorclass evilaccount(account)def _init_ (self,name,balance,evilfactor)account _init_ (self,name,balanceinitialize account self evilfactor evilfactor def inquiry(self)if random randint( , = return self balance self evilfactor elsereturn self balance when derived class defines _init_ ()the _init_ (methods of base classes are not automatically invoked thereforeit' up to derived class to perform the proper initialization of the base classes by calling their _init_ (methods in the previous examplethis is shown in the statement that calls account _init_ (if base class does not define _init_ ()this step can be omitted if you don' know whether the base class defines _init_ ()it is always safe to call it without any arguments because there is always default implementation that simply does nothing occasionallya derived class will reimplement method but also want to call the original implementation to do thisa method can explicitly call the original method in the base classpassing the instance self as the first parameter as shown hereclass moreevilaccount(evilaccount)def deposit(self,amount)self withdraw( subtract the "conveniencefee evilaccount deposit(self,amountnowmake deposit subtlety in this example is that the class evilaccount doesn' actually implement the deposit(method insteadit is implemented in the account class although this code worksit might be confusing to someone reading the code ( was evilaccount supposed to implement deposit()?thereforean alternative solution is to use the super(function as followsclass moreevilaccount(evilaccount)def deposit(self,amount)self withdraw( subtract convenience fee super(moreevilaccount,selfdeposit(amountnowmake deposit super(clsinstancereturns special object that lets you perform attribute lookups on the base classes if you use thispython will search for an attribute using the normal search rules that would have been used on the base classes this frees you from hard-coding the exact location of method and more clearly states your intentions (that isyou want to call the previous implementation without regard for which base class defines itunfortunatelythe syntax of super(leaves much to be desired if you are using python you can use the simplified statement super(deposit(amountto carry out the calculation shown in the example in python howeveryou have to use the more verbose version python supports multiple inheritance this is specified by having class list multiple base classes for examplehere are collection of classesf lib fl ff