Skip to content
Snippets Groups Projects
Commit 97c99369 authored by VALLET Armel's avatar VALLET Armel
Browse files

question 4

parent e6c30e4a
No related branches found
No related tags found
No related merge requests found
...@@ -11,8 +11,17 @@ class TabletteChocolat: ...@@ -11,8 +11,17 @@ class TabletteChocolat:
def __repr__(self): def __repr__(self):
return str(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 # Programme principal
t = TabletteChocolat(1, 2) t = TabletteChocolat(5, 2)
print(t) print(t)
TabletteChocolat(3, 4) TabletteChocolat(3, 4)
print(t.coups_possibles())
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment