I am a beginner, so please bear with me. I am trying to solve a very simple question but am getting a consistent error with the input and int commands. The problem I am trying to solve is the following:
You have a debt of 50k€. You compare different deposits and the most profitable one is a deposit with a 6% annual compound interest. How much money should you invest in that deposit to have 50k€ in N years?
My code is:
FV=50000 #future value of the deposit is 50,000 euros
I=0.06 #the interest rate of the deposit is 6%
N=input("number of months:")
N=int(N)
print(FV/(1+I)**N)
print("I should invest", FV/(1+I)**N, "euros to have", FV, " euros in", N,
"months with interest", I)
But the kernel stops running and executing after the third line (input command) and when I manually hit Enter to get a newline, I get a ValueError code that says:
ValueError: invalid literal for int() with base 10: ''
Can someone tell me why I am getting this error? And where am I wrong in solving the problem? Thanks in advance.
''.int().