HF RL Explorer

mortgage calculator: implement stub

mortgage calculator: implement stub: a task in smol-software-harbor (Harbor dataset). monthly payment() in mortgage.py is a stub. Implement the standard annuity formula P r / (1 - (1 + r) -n) with the monthly rate r (annual percentage / 100 / 12) and n monthly payments, rounded to cents; a 0% loan…

The task

`monthly_payment()` in `mortgage.py` is a stub. Implement the standard annuity formula `P * r / (1 - (1 + r) ** -n)` with the monthly rate `r` (annual percentage / 100 / 12) and `n` monthly payments, rounded to cents; a 0% loan is repaid in equal instalments. Run `python3 -m unittest discover -s tests -t . -q`.

Part of efederici/smol-software-harbor.