Skip to content

Instantly share code, notes, and snippets.

@eliassoares
Last active May 28, 2020 11:31
Show Gist options
  • Save eliassoares/b78a7b74b012d3b3376757d356beab3f to your computer and use it in GitHub Desktop.
Save eliassoares/b78a7b74b012d3b3376757d356beab3f to your computer and use it in GitHub Desktop.
Funções do post sobre como documentar seu código.
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