def team_points_allowed_fn(points_allowed):
    """Return fantasy points scored by a defense based on the number of points
    they allowed. Based on point scale found on
    https://fantasydata.com/developers/fantasy-scoring-system/nfl
    """
    if points_allowed == 0:
        return 10
    elif points_allowed < 7:
        return 7
    elif points_allowed < 14:
        return 4
    elif points_allowed < 21:
        return 1
    elif points_allowed < 28:
        return 0
    elif points_allowed < 35:
        return - 1
    else:
        return -4