我希望下面的函数返回一个每年的元组,如果它是5年,它将给我一个元组year1,year2,year3,year4,year5。在
def nextSalaryFixed(salary, percentage, growth, years):
if years == 1:
tup = (salary * (percentage * 0.01), )
return tup[years-1]
else:
tup = (nextEggFixed(salary, percentage, growth, years - 1) * ((1 + (0.01 * growth))) + (salary * (percentage * 0.01)))
print(tup)
return tup
相关问题 更多 >
编程相关推荐