stefansacc checkingaccount( "stefan" stefansacc deposit( annesacc checkingaccount( "anne" annesacc deposit( annesacc withdraw( print(annesaccprint("trying to withdraw "cash annesacc withdraw( print("got only"cashprint(annesaccas we can seethe checkingaccount class provides constructor method init when creating an object by calling the checkingaccount classpython starts looking for constructor at this class and immediately finds one it executes the init method of the checkingaccount class and sets the four attributes of the object being created the constructor method of the superclass account is not executed in this case the checkingaccount class also overrides the withdraw(selfamountmethod of its superclass overriding method simply works by giving the exact same name to method when we call this method on the annesacc objectpython again starts looking for the method in the object and then at the classes it is linked to from bottom to top it finds the method at the checkingaccount class and executes this method methods with the same name can do different things we have defined class hierarchy by nowsavingsaccount and checkingaccount are both subclasses of account let us create two objects of these classes as follows annesacc savingsaccount( "anne"annesacc deposit( annesacc withdraw( stefansacc checkingaccount( "stefan" stefansacc deposit( stefansacc withdraw( annemarie friedrichcis lmu munchenws /