Why do I get an error of "can't multiply sequence by non-int of type 'float'"? from the following code:
def nestEgVariable(salary, save, growthRates):
SavingsRecord = []
fund = 0
depositPerYear = salary * save * 0.01
for i in growthRates:
fund = fund * (1 + 0.01 * growthRates) + depositPerYear
SavingsRecord += [fund,]
return SavingsRecord
print nestEgVariable(10000,10,[3,4,5,0,3])
SavingsRecord.append(fund)
instead of yourSavingsRecord += [fund,]
, it may be faster.