Skip to content

Commit 360c7fb

Browse files
author
thanmaisai
committed
added a CI calculator.
1 parent 351ac5f commit 360c7fb

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,6 @@ GeneratePassword.py
5151

5252
## Script 10 - Simple TCP Chat Server
5353
server.py - Creates a local server on your LAN for receiving and sending messages!
54+
55+
## Script 11 - compound intrest calculator
56+
calculate compound intrest

calculate_CompoundIntrest.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
print('How many years will you be saving?')
2+
years = int(input('Enter years: '))
3+
4+
print('How much money is currently in your account?')
5+
principal = float(input('Enter current amount in account: '))
6+
7+
print ('How much money do you plan on investin monthly?')
8+
monthly_invest = float(input('Enter amount: '))
9+
10+
print ('What do you estimate will be the yearly interest of this investment?')
11+
interest = float(input ('Enter interest in decimal numbers (10% = 0.1): '))
12+
print(' ' )
13+
14+
monthly_invest = monthly_invest * 12
15+
final_amount = 0
16+
17+
for i in range(0, years):
18+
if final_amount == 0:
19+
final_amount = principal
20+
21+
final_amount = (final_amount + monthly_invest) * (1 + interest)
22+
23+
print("This is how much money you would have in your account after{} years: ".format (years) + str(final_amount))

0 commit comments

Comments
 (0)