total=float(input('分期金额:'))
date=int(input('分期月数:'))
expectedRate=float(input('预计持有资金收益年利率:'))
pddYouhui=float(input('补贴金额为:'))
monthRate=expectedRate/12
monthPay=total/date
monthPayIn=0
totalIn=0
print(f'每月应还{
monthPay}')
for i in range(date):
total -= monthPay
monthPayIn = total*monthRate
totalIn+=monthPayIn
print(f'第{
i}个月收益为{
monthPayIn:.3}')
print(f'总收益为{
totalIn}')
if totalIn>=pddYouhui:
print('选择分期更划算')
else:
print('选择PDD更划算')
写着玩的,各位有兴趣的可以看看