问题描述:
Write a function to calculate electricity bill.

测试用例:
['assert cal_electbill(75)==246.25', 'assert cal_electbill(265)==1442.75', 'assert cal_electbill(100)==327.5']

生成的代码:
def cal_electbill(units):
    if units <= 100:
        bill = units * 3.25
    elif units <= 200:
        bill = 100 * 3.25 + (units - 100) * 4.00
    elif units <= 300:
        bill = 100 * 3.25 + 100 * 4.00 + (units - 200) * 5.75
    else:
        bill = 100 * 3.25 + 100 * 4.00 + 100 * 5.75 + (units - 300) * 6.50
    return round(bill, 2)

assert cal_electbill(75) == 246.25
assert cal_electbill(265) == 1442.75
assert cal_electbill(100) == 327.5