monthly_deposit = monthly_salary * portion_saved # 月存款 # 总共缴纳房款 # 计算多少个月才能存够首付款,结果为整数,不足1月按1个月计算,即向上取整 #每6个月涨一次工资,每年输出年底的存款总额 # === def print_current(number_of_months, monthly_salary, semi_annual_raise, monthly_deposit ): eno...
if current_saving >= down_payment: # 存够了买房去 print(f'需要{number_of_months}个月可以存够首付') enough = False return if number_of_months % 12 == 0: print("第{}个月月末有{:,.0f}元存款".format(number_of_months, current_saving)) # 每12个月输出一次存款,保留0位小数,使用千分...