def qa(country, uv):
    """
    Do qa on uv-index value:
    Rule:
        0 <= uv < 12   --> pass (P)
        12 <= uv < 17  --> doubtful (D)
        >= 17            --> error (E)
        all else        --> not applicable (NA)
    """
    if not isinstance(uv, float):
        return 'NA'
    if 0 <= uv < 12:
        return 'P'
    elif 12 <= uv < 17:
        return 'D'
    elif uv >= 17:
        return 'E'
    else:
        return 'E'