title: Python test andela
body: <p>HST2: OBJECT ORIENTED PROGRAMMING LAB
  Create a class called ShoppingCart.</p>
  
  <p>Create a constructor that takes no arguments and sets the total attribute to zero, and initializes an empty dict attribute named items.</p>
  
  <p>Create a method add_item that requires item_name, quantity and price arguments. This method should add the cost of the added items to the current value of total. It should also add an entry to the items dict such that the key is the item_name and the value is the quantity of the item.</p>
  
  <p>Create a method remove_item that requires similar arguments as add_item. It should remove items that have been added to the shopping cart and are not required. This method should deduct the cost of the removed items from the current total and also update the items dict accordingly.</p>
  
  <p>If the quantity of an item to be removed exceeds the current quantity of that item in the cart, assume that all entries of that item are to be removed.</p>
  
  <p>Create a method checkout that takes in cash_paid and returns the value of balance from the payment. If cash_paid is not enough to cover the total, return "Cash paid not enough".</p>
  
  <p>Create a class called Shop that has a constructor which takes no arguments and initializes an attribute called quantity at 100.</p>
  
  <p>Make sure Shop inherits from ShoppingCart.</p>
  
  <p>In the Shop class, override the remove_item method, such that calling Shop's remove_item with no arguments decrements quantity by one.</p>
  
  <p><code># OOP Lab</p>
  
  <pre><code>class ShoppingCart(object):
    def __init__(self):
      total = 0
      item = {}
      self.total = total
      self.item = item
    def add_item(item_name, quantity, price):
      cost = quantity * price
      self.total += cost
      self.item = {"item_name":quantity}
    def remove_item(item_name,quantity,price):
      cost = quantity * cost
      self.total -= cost
      for i in self.item:
          if quantity &gt; self.item[i]:
              del self.item["item_name"]
      def checkout(cash_paid):
          if cash_paid &lt; self.total:
              return "Cash paid not enough"
  class Shop(ShoppingCart):
      def __init__(self):
          quantity = 100
          self.quantity = quantity
      def remove_item():
          self.quantity -= 1
  </code></pre>
  
  <p></code></p>
  
  <p><code>#! Error State the following:
  my add_item is having four argument instead of three each time i run this code:</p>
  
  <p></code>
  Please i need help with this code, am new with python, i will appreciate any programming angel in python to rescue me now.</p>