From 97c993693c93fe9d41973a0b2e0336c874c6ba7d Mon Sep 17 00:00:00 2001 From: Armel Vallet <armel.vallet@etu.univ-amu.fr> Date: Fri, 10 Jan 2025 13:41:49 +0100 Subject: [PATCH] question 4 --- main.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 267ecee..aa3c730 100644 --- a/main.py +++ b/main.py @@ -11,8 +11,17 @@ class TabletteChocolat: def __repr__(self): return str(self) + def coups_possibles(self): + l = [] + for i in range(self.m): + for j in range(self.n): + if (i == 0 or j == 0) and (i, j) != (0, 0): + l.append(tuple([i, j])) + return l + # Programme principal -t = TabletteChocolat(1, 2) +t = TabletteChocolat(5, 2) print(t) -TabletteChocolat(3, 4) \ No newline at end of file +TabletteChocolat(3, 4) +print(t.coups_possibles()) \ No newline at end of file -- GitLab