Код: Выделить всё
def presentValue(amount, num_months, interest):
return (amount)/(1 + interest)**num_months
Код: Выделить всё
def getPrincipal(amount, num_months, interest):
return
getPrincipal = 0
for presentValue in range(1,240):
getPrincipal = getPrincipal + presentValue
Код: Выделить всё
A = 100
interest = 0.01
num_months = 240
P = getPrincipal(A, num_months, interest)
print(P)
Подробнее здесь: https://stackoverflow.com/questions/797 ... l-function