def P(p_0, t, i):
return p_0 * (1+i)**t
when i call the fuction P(1000,7,5) it returns it as 1000 and any otha number i put as p_0 it returns that number and i cant figure out why
def P(p_0, t, i):
return p_0 * (1+i)**t
when i call the fuction P(1000,7,5) it returns it as 1000 and any otha number i put as p_0 it returns that number and i cant figure out why
hm, I tried this on the python console
>>> def P(p_0, t, i):
... return p_0 *(1+i) ** t
...
>>> P(10000, 5, 7)
327680000
>>> P(10000, 7, 5)
2799360000L
>>>
so I can't see your problem ?
It also works for me, but maybe try
def P(p_0, t, i):
return (p_0 * (1+i)**t)
or
def P(p_0, t, i):
a= p_0 * (1+i)**t
return a
And see if that fixes it for you.
(also could check your version of Python and get one of the newer ones if it's old)
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.