Skip to content
Snippets Groups Projects
Commit b94a4268 authored by KONATE Oumonmian ibrahim's avatar KONATE Oumonmian ibrahim
Browse files

Add file

parent 35364ccf
Branches main
No related tags found
No related merge requests found
# question 1)
import itertools as iter
import itertools as it
class TabletteChocolat:
def __init__(self,m,n):
self.m=m
......@@ -15,12 +15,23 @@ class TabletteChocolat:
return "Tablette Chocolat de "+ str(self.m)+"X"+str(self.n)
def __repr__(self):
return str(self)
def coups_possible(self):
for i,j in range(self.m, self.n):
def coups_possibles(self):
j=0
for i in range(self.m):
if 0<i < self.m:
for j in range(self.n):
if i==0 and 0<j<self.n:
print(it.chain(range(5), range(self.m, self.m)))
#[ iter.tuple(range(3), range(self.m,self.n)) for 0<i<self.m and j==0 ]
t=TabletteChocolat(3, 4)
t=TabletteChocolat(4, 4)
g=t.coups_possibles()
list(g)
print(t)
\ 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