Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def investment(PMT, n, i):
- investment_balance = 0
- for x in range(0, n):
- if x % 2 == 1:
- PMT = 2 * PMT
- investment_balance *= (1 + i)
- investment_balance += (PMT)
- return round(investment_balance, 2)
- print(investment(10000, 40, 0.1045) == 41728281751.16)
- print(investment(15000, 30, 0.1045) == 1954935238.47)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement