diff --git a/main.py b/main.py index d9943780aea2cd50563fba4655534a8480207d3e..267eceee161071e3c2f81e0957df1b18e206d57f 100644 --- a/main.py +++ b/main.py @@ -5,6 +5,14 @@ class TabletteChocolat: self.m = m self.n = n + def __str__(self): + return "Tablette de chocolat de " + str(self.m) + "x" + str(self.n) + + def __repr__(self): + return str(self) + # Programme principal -t = TabletteChocolat("a", "b") +t = TabletteChocolat(1, 2) +print(t) +TabletteChocolat(3, 4) \ No newline at end of file