代码如下
import sysage_min = 22age_max = 60def getIncomeGrowth(i): return max(0.03, 0.074 - (0.044 * i / 25))def getInterestRate(i): return max(0.02, 0.0345 - (0.0145 * i / 10))def retire(age, s): income_2021 = 75002 shebao_2021 = 27000 interest_2021 = 0.0345 if age age_max: print('你不在考虑退休的年纪') return for i in range(age, age_max + 1): s = s - (income_2021+shebao_2021) interest_rate = 1 + getInterestRate(i-age) s = int(s * interest_rate) print("{}岁,剩余{}".format(i,s)) if s ".format(sys.argv[0])) sys.exit(1)age = int(sys.argv[1])savings = int(sys.argv[2])retire(age, savings)
想要的结果类似是
35岁,剩余175657836岁,剩余171165837岁,剩余166518938岁,剩余161711639岁,剩余1567385
可是我python代码跑完之后结果是Usage: script.py
是哪里出了问题