SHARE
TWEET

Untitled

a guest Sep 21st, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def investment(PMT, n, i):
  2.     investment_balance = 0
  3.     for x in range(0, n):
  4.         if x % 2 == 1:
  5.             PMT = 2 * PMT
  6.         investment_balance *= (1 + i)
  7.         investment_balance += (PMT)
  8.  
  9.     return round(investment_balance, 2)
  10.  
  11.  
  12. print(investment(10000, 40, 0.1045) == 41728281751.16)
  13. print(investment(15000, 30, 0.1045) == 1954935238.47)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top