diff --git a/main.py b/main.py index 8016ced6abb21a65e3baaea91cbb017cc53acc73..30f0de8661dab5a5c740beca4a951081553a26f1 100644 --- a/main.py +++ b/main.py @@ -10,5 +10,11 @@ class TabletteChocolat: self.m = m self.n = n + def __str__(self): + return 'Tablette de chocolat de ' + str(self.m) + 'x' + str(self.n) + # __repr__ n'est pas surchargé car à priori dans notre cas __str__ suffit + A = TabletteChocolat(1, 2) -B = TabletteChocolat(1, 'ouioui') +B = TabletteChocolat(4, 8) +print(A) +print(B)