Removed bloat
Claned up a and b functions
cleaned up description of one function
A python script that calculates compound interest on investments. Calculations are based on these formulas.
Clone and cd into the project folder
git clone https://git.sr.ht/~rickylinden/pengan && cd pengan
Make executable if needed and run the script as
python3 pengan.py
The script will ask you if you want to:
a) See how much monthly investment becomes over time
b) See how much you need to invest to reach a certain amount of money
Enter the values it asks for, if fields are left empty it runs with example values.
You put 1000€ into an investment account that on average gives 5% annual interest. Additionally you'll add 100€ per month for 10 years. So if you started in 2021 you should have 16533.24€ in 2031.
$ python3 pengan.py
+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+
|c|o|m|p|o|u|n|d| |i|n|t|e|r|e|s|t| |c|a|l|c|u|l|a|t|o|r|
+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+
a) How much does a monthly investment become in x amount of years?
b) How long does it take to get a certain sum by investing?
Choose a or b: a
Starting amount (empty = 0€): 1000
Monthly sum (empty = 500€): 100
Years (empty = 30): 10
Average interest rate (empty = 5%): 5
After 10 years you should in total have: ~16533.24€.
Which means that in the year 2031 you'll get a monthly average of ~68.88€ in interest.