M = L * (I * (1 + I) ** n / ((1 + I) ** n - 1))
M = None
L = None
I = None
n = None
L = input('Enter loan amount: ')
L = float(L)
print(L)
I = input('Enter interest rate: ')
I = float(I) / 100 / 12
print(I)
n = input('Enter number of payments: ')
n = float(n)
print(n)
M = L * (I * (1 + I) ** n / ((1 + I) ** n - 1))
M = str(M)
print('\n')
print('Monthly payment is ' + M)
Формула расчета процентов Python