From 35364ccfac3dce2ec983f2d3b770ef6ed0bee0f0 Mon Sep 17 00:00:00 2001 From: Konate Oumonmian Ibrahim <oumonmian-ibrahim.KONATE@etu.univ-amu.fr> Date: Fri, 10 Jan 2025 14:25:05 +0100 Subject: [PATCH] Add file test.py --- test.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/test.py b/test.py index 29ed6aa..9342eea 100644 --- a/test.py +++ b/test.py @@ -1,5 +1,26 @@ +# question 1) +import itertools as iter class TabletteChocolat: def __init__(self,m,n): self.m=m self.n=n - \ No newline at end of file + try: + m=int(m) + n=int(n) + except ValueError: + print("Les entrées doivent être des entiers") + + + def __str__(self): + 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): + + + +t=TabletteChocolat(3, 4) +t=TabletteChocolat(4, 4) + +print(t) \ No newline at end of file -- GitLab