input: Write a python function to calculate the tax based on given tax brackets and item price.
  assert calculate_tax([0.01, 0.05, 0.1, 0.15, 0.2], 110) == 1.05
  assert calculate_tax([0.01, 0.05, 0.1, 0.15, 0.2], 50) == 0.5
  assert calculate_tax([0.01, 0.05, 0.1, 0.15, 0.2], 250) == 16.5
output: def calculate_tax(tax_brackets, item_price):
      tax = 0
      for bracket in tax_brackets:
          if item_price > 100:
              tax += 100 * bracket
              item_price -= 100
          else:
              tax += item_price * bracket
              break
      return tax