You never state the problem you have encountered. Formula aside, I will only comment on your code which is the purpose of this forum. Suggest you revisit the basic syntax of Python which is the indentation of code block, you failed to observe this in:
def compound(PV, N, M, IR):
and
if __name__ == "__main__":
Read
Lexical analysis — Python 3.5.2 documentation[
^] and figure it out yourself.
+++++[Round 2]+++++
I saw that you have added the indentation, but you still miss the point, I will provide you the answer below:
def compound(PV, N, M, IR):
for i in range(N):
PV += (M * 12)
FV = (PV*(1+IR)**N)
print(i + FV)
if __name__ == "__main__":
compound(PV, N, M, IR)
The indentation is Python' way of grouping related code as a block, must like the {} used in other programming languages.