Skip to content

Commit

Permalink
ajout de la classe cartepizzeria
Browse files Browse the repository at this point in the history
  • Loading branch information
amina-sab committed Mar 6, 2024
1 parent 17b8065 commit c17351e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions CartePizzeria.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class CartePizzeria:
def __init__(self):
self.pizzas=[]

def is_empty(self):
return len(self.pizzas)==0

def nb_pizzas(self):
return len(self.pizzas)

def add_pizza(self,pizza):
self.pizzas.append(pizza)

def remove_pizza(self,name):
for p in self.pizzas:
if(p.name==name):
self.pizzas.remove(p)

raise CartePizzeriaException("Pizza not found: " + name)

0 comments on commit c17351e

Please sign in to comment.