trying to create a function to get the principal amount for a loan using the for loop for the sum of present values
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
something must be wrong here but no errors occur
A = 100
interest = 0.01
num_months = 240
P = getPrincipal(A, num_months, interest)
print(P)
doing print(P) returns None