Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,6 @@ Automatically change home wallpaper adding a random quote and stock tickers on i

## Script 12 - Star Pattern
Create a star pattern pyramid

## Script 13 - compound interest calculator
calculate compound interest
23 changes: 23 additions & 0 deletions calculate_CompoundIntrest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
print('How many years will you be saving?')
years = int(input('Enter years: '))

print('How much money is currently in your account?')
principal = float(input('Enter current amount in account: '))

print ('How much money do you plan on investin monthly?')
monthly_invest = float(input('Enter amount: '))

print ('What do you estimate will be the yearly interest of this investment?')
interest = float(input ('Enter interest in decimal numbers (10% = 0.1): '))
print(' ' )

monthly_invest = monthly_invest * 12
final_amount = 0

for i in range(0, years):
if final_amount == 0:
final_amount = principal

final_amount = (final_amount + monthly_invest) * (1 + interest)

print("This is how much money you would have in your account after{} years: ".format (years) + str(final_amount))