[ create a new paste ] login | about

Link: http://codepad.org/L6SUqoTC    [ raw code | output | fork ]

Python, pasted on Oct 12:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
balance = 320000
annualInterestRate = 0.2
monthlyInterestRate = annualInterestRate/12
epsilon = 0.01
low = balance/12
high = (balance(1 + monthlyInterestRate)**12)/12
pay = (low + high)/2.0
while (pay - balance)>= epsilon:
    print('low ' + str(low) + 'high ' + str(high) + 'pay ' + str(pay))
    if(pay < balance):
      low = pay
    else:
     high = pay
    pay = (high + low)/2.0
print 'Low Payment: ' + pay
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                           


Output:
1
2
3
4
  Line 16
    ~                                                                               
                                                                                   ^
SyntaxError: invalid syntax


Create a new paste based on this one


Comments: