def cable_pricer(num_cables):
    """
    Calculates the price for some number of cables num_cables.  Cable price
    per unit is:
        $3.00 if there are less than 10 cables
        $2.70 if there are between 10 and 50 cables
        $2.25 if there are between 50 and 100 cables
        $1.75 if there are between 100 and 500 cables
        $1.00 if there are 500 or more cables
    Factors in shipping costs as well.  Shipping $5.00 per box.  100 cables
    can fit into one box.
    """
    if num_cables < 10:
        return num_cables * 3.00 + 5.00
    elif num_cables < 50:
        return num_cables * 2.70 + 5.00
    elif num_cables < 100:
        return num_cables * 2.25 + 5.00
    elif num_cables < 500:
        if num_cables % 100 == 0:
            boxes = int(num_cables/100)
        else:
            boxes = int(num_cables/100) + 1
            
        return num_cables * 1.75 + 5.00 * boxes
    else:
        if num_cables % 100 == 0:
            boxes = int(num_cables/100)
        else:
            boxes = int(num_cables/100) + 1
            
        return  num_cables * 1.00 + 5.00 * boxes

def bill_amount(megabytes, rate):
    """
    An internet service provider charges a base rate per megabyte (MB)
    transferred depending on market conditions. In addition to the base,
    transfers between 100 and 500 MB are charged and additional $0.05 per
    MB plus 33% of the base.  Data transfers between 500 MB and 1500 MB are
    charged 1.44 times the base plus $0.08 per MB.  Above 1500 MB, the rate
    is simply twice the base.
    """
    if megabytes < 100:
        return megabytes * rate
    elif megabytes < 500:
        return megabytes * (rate * 1.33 + .05)
    elif megabytes < 1500:
        return megabytes * (rate * 1.44 + .08)
    else:
        return megabytes * rate * 2
