Still trying wake GIT on Ubuntu

All GIT request were failing this Ubuntu 14.04.1 install
Your approach is innovative, if not exactly what I would've done. If you keep going round in circles, you could always try the more mundane approach:

    PR_A = int(PR_A)
    T_P = int(T_P)
    QUAL = True if PRE_Q.lower()[0] == 'y' else False
    R = None
    TOTAL = None
    if 0 <= PR_A <= 199999:
        if 1 <= T_P <= 15:
            if PRE_Q:
                R = '0.0XXX'
    # and so on
    if R:
        R = decimal.Decimal(R)
        TOTAL =   # your formula