Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def payment(balance, annualInterestRate, monthlyPaymentRate):
- month = 0
- monthlyInterestRate = annualInterestRate/12
- # Tant que l'année n'est pas terminé et que la balance est plus grande que 0.
- while month < 12 and balance > 0:
- # On soustrait les paiements mensuels de la balance.
- balance -= (monthlyPaymentRate*balance)
- # On rajoute les intérets à la balance.
- balance += (monthlyInterestRate*balance)
- month += 1
- # On arrondit le solde à 2 décimales.
- return round(balance, 2)
- print("Remaining balance: ", payment(balance, annualInterestRate, monthlyPaymentRate))
Add Comment
Please, Sign In to add comment