From a18eea31b482d2508b3ca54dcbb3887ab1b5ffa9 Mon Sep 17 00:00:00 2001 From: ALI SAID IDJIHADI Samir <s23027942@V-PP-02-nux-027.salsa.univ-amu.fr> Date: Fri, 10 Jan 2025 15:15:32 +0100 Subject: [PATCH] question8 --- exam.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/exam.py b/exam.py index d81f181..daa6c4f 100644 --- a/exam.py +++ b/exam.py @@ -35,7 +35,16 @@ class TabletteChocolat: plt.axis('off') plt.show() plt.close() - + def demender_coup(self): + n=0 + x = input("couper des lignes (l) ou des colones (c)") + if x=="c": + while not self.est_possible(0, int(n)): + n = input("combien de colonnes a couper" + str(list(range(1, self.n)))) + return self.coup(int(n),0) + else: + raise ValueError("il faut repondre l ou c") + -- GitLab