input: Write a python function to add, remove, and calculate the total in a shopping cart.
  assert shopping_cart == {}
  add_item_to_cart("apple", 2)
  assert shopping_cart == {"apple": 2}
  add_item_to_cart("banana", 3)
  assert shopping_cart == {"apple": 2, "banana": 3}
  remove_item_from_cart("apple")
  assert shopping_cart == {"banana": 3}
  shopping_cart["banana"].price = 0.5  # Assuming price property exists on each item
  assert calculate_total() == 1.5
  clear_cart()
  assert shopping_cart == {}
output: shopping_cart = {}
  
  def add_item_to_cart(item, quantity):
      if item in shopping_cart:
          shopping_cart[item] += quantity
      else:
          shopping_cart[item] = quantity
  
  def remove_item_from_cart(item):
      if item in shopping_cart:
          del shopping_cart[item]
  
  def calculate_total():
      total = 0
      for item, quantity in shopping_cart.items():
          total += quantity * shopping_cart[item].price
      return total
  
  def clear_cart():
      shopping_cart.clear()