HW 3

There's a lot of duplication of effor here that I'd like you to reduce. Try nesting your ifs starting with the principal size, then the duration, and finally prequal, eg:

    if PRINCIPAL > 0 and PRINCIPAL < 200000:
        if DURATION > 0 and DURATION < 15:
            if PW == 'y':
                IR = ...

A few more notes while I'm here. Always be certain to check your lower bounds as well as your upper bounds. The table says it's for loans from 0 to 1,000,000+ but you've not gated your code to protect against loans that are lower than zero. You might be thinking that that makes no sense but always try to avoid making assumptions about your users or the input of functions and code. Even if not ignorant or malicious typos happen too and good program code always does what's expected.