Lesson 3

Leave a comment
I am converting the interest to decimal in the final total is that not correct ?

Sent from my iPhone

> On Sep 15, 2014, at 8:41 AM, Chad Heuschober <notifications@github.com> wrote:
> 
> In task_05.py:
> 
> > +    if int(T) > 20 < 31 and Q == 'yes':
> > +        R = .0466
> > +if int(P) > 1000000:
> > +    if int(T) < 16 and Q == 'yes':
> > +        R = .0205
> > +    if int(T) > 15 < 21 and Q == 'yes':
> > +        R = .0262
> > +
> > +TOTAL = int(round(int(P) * (1 + R / N) ** (N * int(T)), 0))
> > +REPORT = '''Loan Report For: {n}
> > +-----------------------------
> > +    Principal:      {pr} 
> > +    Duration:       {Time}
> > +    Prequalified?:  {q}
> > +    Total:          {total}'''.format(n=NAME, pr=P, Time=T, q=Q, total=TOTAL)
> > +print REPORT
> Hi Anthony,
> 
> Did you see all my other notes as above? There were three primary issues I was able to identify. Probably the most egregious right now are the comparisons. I can see you trying to use the shorthand form but you've got your variable in the wrong place. As I pointed out above, you're effectively comparing the middle number against the two on the outsides (lowerbound <= comparison <= upperbound or 100 <= x <= 200) I think the wrong interest rate is being selected. Alternately, you could use the long form x >= 100 and x <= 200
> 
> You could run your code with python -i and check R to make sure the correct rate is chosen.
> 
> I also still see you using floats instead of decimals.
> 
> —
> Reply to this email directly or view it on GitHub.