Skip to content

Commit 2bf6db4

Browse files
authored
Rename function to ordinary_annuity_future_value
1 parent 72eebde commit 2bf6db4

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

financial/get_ordinary_annuity_future_value.py renamed to financial/ordinary_annuity_future_value.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66
77
0: no payment --- 1: $1000 --- 2: $1000 --- 3: $1000
88
9-
The function, get_ordinary_annuity_future_value, calculates the future value of
9+
The function, ordinary_annuity_future_value, calculates the future value of
1010
the given ordinary annuity. In the example above, the function should return
1111
the sum of each payment's future value at the end of term 3,
1212
which means the sum is returned as soon as the last payment is made.
1313
1414
More info on: https://www.investopedia.com/retirement/calculating-present-and-future-value-of-annuities
1515
16-
This function can help to understand how much you will receive
17-
if you make a regular deposit at the end of each term
18-
for saving with a fix period and interest rate.
16+
This function can help you understand how much you will receive if you make a
17+
regular deposit at the end of each term for saving with a fixed period and
18+
interest rate.
1919
"""
2020

2121

22-
def get_ordinary_annuity_future_value(
22+
def ordinary_annuity_future_value(
2323
term_payment: float, number_of_payments: int, term_interest_rate: float
2424
) -> float:
2525
"""
@@ -30,13 +30,13 @@ def get_ordinary_annuity_future_value(
3030
:return: the future value (maturity value) of the given ordinary annuity
3131
3232
Examples:
33-
>>> round(get_ordinary_annuity_future_value(500, 10, 0.05), 2)
33+
>>> round(ordinary_annuity_future_value(500, 10, 0.05), 2)
3434
6288.95
35-
>>> round(get_ordinary_annuity_future_value(1000, 10, 0.05), 2)
35+
>>> round(ordinary_annuity_future_value(1000, 10, 0.05), 2)
3636
12577.89
37-
>>> round(get_ordinary_annuity_future_value(1000, 10, 0.10), 2)
37+
>>> round(ordinary_annuity_future_value(1000, 10, 0.10), 2)
3838
15937.42
39-
>>> round(get_ordinary_annuity_future_value(1000, 20, 0.10), 2)
39+
>>> round(ordinary_annuity_future_value(1000, 20, 0.10), 2)
4040
57275.0
4141
"""
4242

@@ -52,7 +52,7 @@ def get_ordinary_annuity_future_value(
5252
user_input_payment_number = int(input("How many payments will be made?\n> "))
5353
term_interest_rate = float(input("What is the interest rate per term?\n> "))
5454
print(
55-
get_ordinary_annuity_future_value(
55+
ordinary_annuity_future_value(
5656
user_input_amount, user_input_payment_number, term_interest_rate
5757
)
5858
)

0 commit comments

Comments
 (0)