Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I put this equation into python?

Tags:

python

I need to put this equation

P*(1 + r/100n)^nt

into python. Can anyone help me?

I've tried this, but it won't get me right answer

p*(1+r/100*n)**(n*t)

p is 116000 t is 35 r is 4 n is 12

I'm suppose to get $469,309.30 from above values, but the number I get is way too high. Its only been hours since I started to learn programming. I just have no idea what to do.

like image 593
Matthew Lee Avatar asked Apr 24 '26 02:04

Matthew Lee


1 Answers

It might be an order of operations issue where Python is dividing r by 100 first. I would try the following:

p*(1+r/(100*n))**(n*t)
like image 184
jbinvnt Avatar answered Apr 26 '26 14:04

jbinvnt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!