In the following code I keep getting the response that object of NoneType has no len(), but there is no length function anywhere in the code- does anyone know what is wrong?
def constant_pension(salary, save, growth_rate, years):
if salary<0 or save<0 or save>100 or growth_rate<=-100 or years<=0: #invalid
return(None)
i=0
fund_list=[]
old_fund=0
new_fund=0
while i<years:
new_fund=old_fund*(1+growth_rate*.01)+salary*save*.01
fund_list.append(new_fund)
old_fund=new_fund
i=i+1
return(fund_list)
pass