Calculate Compound Interest (FV) with Python
This Snippet is coded by a user inOnline python Compiler. You can see and run this code too.
زبان: python
This Python code calculates the Future Value (FV) of a series of monthly deposits with compound interest, also known as annuity due. It determines how much your investment will grow over a specified number of years with a given annual interest rate.
The formula used is:
FV = P * (1 + r) * ((1 + r)^(12*n) - 1) / r
Where P is the monthly deposit, r is the monthly interest rate (annual rate divided by 1200), and n is the number of years.
How to use:
- Set P to your monthly deposit amount in Tomans.
- Set R to your annual interest rate (e.g., 18 for 18%).
- Set n to the number of years.
- Run the code to see the FV with comma formatting.
This is useful for financial planning, estimating returns on savings, and understanding the power of compound interest.