From c963b29e2620b8ec621de8acc8ee7687c7047ea5 Mon Sep 17 00:00:00 2001 From: Leo Litaize <litaizeleo40@gmail.com> Date: Fri, 10 Jan 2025 14:32:49 +0100 Subject: [PATCH] =?UTF-8?q?Question=205;=20et=20question=202=20chang=C3=A9?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 2961506..3bb9e41 100644 --- a/main.py +++ b/main.py @@ -1,3 +1,4 @@ +import matplotlib.pyplot as plt from itertools import chain as ch class TabletteChocolat: def __init__(self, m, n): @@ -6,13 +7,14 @@ class TabletteChocolat: try: self.m==int and self.n==int except : - raise TypeError("Rentrer des entiers") + TypeError, print("Rentrer des entiers") def __str__(self): return "("+str(self.m) + "x" + str(self.n) + ")" def __repr__(self): - return str(self) + return "Tablette de chocolat de "+ str(self.n) + "x" + str(self.m) + ")" + def coups_possibles(self): for i in range(self.m): for j in range(self.n): @@ -23,7 +25,6 @@ class TabletteChocolat: #return itertools.chain ?????? #help(itertools.chain) ?????? - def est_possible(self, i, j): for a in list(g): if a==(i,j): @@ -31,6 +32,7 @@ class TabletteChocolat: else: return "Ce coup n est pas possible" + #def coupe(self,i,j): -- GitLab