Skip to content

Commit c04dc3e

Browse files
committed
Fixed end condition on mortgage calculation
1 parent d47e806 commit c04dc3e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Notes/01_Introduction/03_Numbers.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,11 @@ The output should look something like this:
234234
4 10736.44 497581.83
235235
5 13420.55 496970.98
236236
...
237-
308 875705.88 674.44
238-
309 878389.99 -2006.86
239-
Total paid 878389.99
240-
Months 309
237+
308 874705.88 2971.43
238+
309 877389.99 299.7
239+
310 880074.1 -2383.16
240+
Total paid 880074.1
241+
Months 310
241242
```
242243

243244
### Exercise 1.11: Bonus

Solutions/1_10/mortgage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
principal = principal * (1+rate/12) - payment
1616
total_paid = total_paid + payment
1717

18-
if month >= extra_payment_start_month and month <= extra_payment_end_month:
18+
if month >= extra_payment_start_month and month < extra_payment_end_month:
1919
principal = principal - extra_payment
2020
total_paid = total_paid + extra_payment
2121

0 commit comments

Comments
 (0)