Skip to content
Snippets Groups Projects
Commit e19fc654 authored by CHOPIN Lou-anne's avatar CHOPIN Lou-anne
Browse files

question 6

parent d0e9c985
No related branches found
No related tags found
No related merge requests found
import matplotlib.pyplot as plt
class TabletteChocolat :
def __init__(self, m, n):
if not isinstance(m, int) or not isinstance(n, int) :
......@@ -25,8 +24,13 @@ class TabletteChocolat :
coup = i, j
return 0<= i < self.m and 0 <= j < self.n and self.tablette[i][j] == 1
def coupe(self, i, j):
coup = i, j
if not self.est_possible(coup):
raise ValueError('Coup impossible')
for x in range (i, self.m):
for y in range(j, self.n):
self.tablette[x][y] = 0
t = TabletteChocolat(3, 4)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment