Apr-16-2018, 01:54 AM
Hello
Anyway, my assignment question is to create a program that acts as an investment calculator using the following formula:
S = P(1+j/n)^nt
Answer needs to in float
TypeError: 'float' object is not callable for Var S. I have tried adding brackets, removing brackets, adding a multiplication for n and t. But no luck. Can anyone assist?
Thanks in advance
Anyway, my assignment question is to create a program that acts as an investment calculator using the following formula:
S = P(1+j/n)^nt
Answer needs to in float
def invest_calc(P,j,t): n = 12 S = P(1+j/n)**n*t return invest_calc(P,j,t) P=float(input("Enter initial value: ")) j=float(input("Enter the annual interest rate: ")) t = float(input("Enter the time: ")) print(invest_calc(P,j,t))I get the following error
TypeError: 'float' object is not callable for Var S. I have tried adding brackets, removing brackets, adding a multiplication for n and t. But no luck. Can anyone assist?
Thanks in advance