TelenkovDmitry 8 月之前
父節點
當前提交
c09de3fb04
共有 1 個文件被更改,包括 2 次插入6 次删除
  1. 2 6
      courses/python_oop/method_task_2.py

+ 2 - 6
courses/python_oop/method_task_2.py

@@ -55,16 +55,12 @@ class Cart:
 
 
         self.__total += product.price * count
         self.__total += product.price * count
     
     
-    def remove(self, product:Product, count=1):
+    def remove(self, product:Product, number=1):
         if number >= self.goods[product]:
         if number >= self.goods[product]:
             number = self.goods[product]
             number = self.goods[product]
             self.goods[product] = self.goods.get(product, 0) - number
             self.goods[product] = self.goods.get(product, 0) - number
             self.__total -= number * product.price
             self.__total -= number * product.price
-        '''
-        else:
-            self.__total -= self.goods[product] * product.price
-            self.goods[product] = 0
-        '''
+
 
 
     @property
     @property
     def total(self):
     def total(self):