Skip to content

Commit 24cd6df

Browse files
committedJun 21, 2020
Minor tweak to exercise 1.9
1 parent 2f2f5ea commit 24cd6df

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎Notes/01_Introduction/03_Numbers.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,14 @@ Modify the program so that extra payment information can be more generally handl
213213
Make it so that the user can set these variables:
214214

215215
```python
216-
extra_payment_start_month = 60
216+
extra_payment_start_month = 61
217217
extra_payment_end_month = 108
218218
extra_payment = 1000
219219
```
220220

221221
Make the program look at these variables and calculate the total paid appropriately.
222222

223-
How much will Dave pay if he pays an extra $1000/month for 4 years starting in year 5 of the mortgage?
223+
How much will Dave pay if he pays an extra $1000/month for 4 years starting in year 5 of the mortgage?
224224

225225
### Exercise 1.10: Making a table
226226

‎Solutions/1_10/mortgage.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
month = 0
88

99
extra_payment = 1000.0
10-
extra_payment_start_month = 60
10+
extra_payment_start_month = 61
1111
extra_payment_end_month = 108
1212

1313
while principal > 0:
1414
month = month + 1
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)