addinterest py def addinterest(balancesrate)for in range(len(balances))balances[ibalances[ ( +ratedef test()amounts [ rate addinterest(amountsrateprint(amountstest(take moment to study this program the test function starts by setting amounts to be list of four values then the addinterest function is called sending amounts as the first parameter after the function callthe value of amounts is printed out what do you expect to seelet' run this little program and see what happens addinterest test([ isn' that interestingin this examplethe function seems to change the value of the amounts variable but just told you that python passes parameters by valueso the variable itself (amountscan' be changed by the function so what' going on herethe first two lines of test create the variables amounts and ratesand then control transfers to the addinterest function the situation at this point is depicted in figure notice that the def test()amounts [ , , , rate addinterest(amounts,rateprint(amountsdef addinterest(balancesrate)for in range(len(balances))balances[ibalances[ ( +raterate rate balances amounts figure transfer of list parameter to addinterest