Last active
May 28, 2020 11:31
-
-
Save eliassoares/b78a7b74b012d3b3376757d356beab3f to your computer and use it in GitHub Desktop.
Funções do post sobre como documentar seu código.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calculate_compound_interest_investment( | |
principal_amount: float, rate: float, time: int | |
) -> float: | |
""" | |
Returns the compound interest an accrued amount that includes | |
principal plus interest. | |
:param principal_amount: float | |
:param rate: float | |
:param time: int | |
:return float principal_amount * (1 + rate)**time | |
""" | |
return principal_amount * (1 + rate) ** time | |
def calculate_simple_interest_investment(principal_amount: float, rate: float, time: int) -> float: | |
""" | |
Returns the simple interest an accrued amount that includes | |
principal plus interest. | |
:param principal_amount: float | |
:param rate: float | |
:param time: int | |
:return float principal_amount * (1 + rate * time): | |
""" | |
return principal_amount * (1 + rate * time) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment