parameters by value some programming languages ( +and ada)do allow variables themselves to be sent as parameters to function such mechanism is called passing parameters by reference when variable is passed by referenceassigning new value to the formal parameter actually changes the value of the parameter variable in the calling program since python does not allow passing parameters by referencean obvious alternative is to change our addinterest function so that it returns the newbalance this value can then be used to update the amount in the test function here' working versionaddinterest py def addinterest(balancerate)newbalance balance ( +ratereturn newbalance def test()amount rate amount addinterest(amountrateprint(amounttest(you should easily be able to trace through the execution of this program to see how we get this output addinterest test( now suppose instead of looking at single accountwe are writing program that deals with many bank accounts we could store the account balances in python list it would be nice to have an addinterest function that adds the accrued interest to all of the balances in the list if balances is list of account balanceswe can update the first amount in the list (the one at index with line of code like thisbalances[ balances[ ( raterememberthis works because lists are mutable this line of code essentially says"multiply the value in the th position of the list by ( +rateand store the result back into the th position of the list of coursea very similar line of code would work to update the balance of the next location in the listwe just replace the with balances[ balances[ ( ratea more general way of updating all the balances in list is to use loop that goes through positions length here is program that implements this idea