I’m trying this example:

p = 10000
n = 12
r = 8
t = int(input("Enter the number of months the money will be compounded "))
a = p (1 + (r/n)) ** n,t
print (a)
.. but the error is:
TypeError: 'int' object is not callable
Is Python seeing p as a function? If so, is there no way I could do it without importing modules?
Thanks!
Assuming you are using python 3..
Also double check the units for
t, is it in months or years? The formula seems to suggest years (ifn = 12is months per year) but you are prompting for months.If in python 2.x you would need to import division from
__future__, or convert r to float first. And you would useraw_inputfor the prompt.