Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

compound interest python

def compound_interest(initial_amount, rate, periods_elapsed):
    return initial_amount * (1 + (rate/100))**periods_elapsed

# Example: 100 of money, 5 %, 12 months passed
print(compound_interest(100, 5, 12)) # -> 179.5856

# The formula:
# A = P(1 + r/100)^t
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #compound #interest #python
ADD COMMENT
Topic
Name
5+2 =