From 44356e748456661c1d76e14699cd7ba3758be4e3 Mon Sep 17 00:00:00 2001 From: rachida0001 <rachida.guedouari.ro@gmail.com> Date: Fri, 10 Jan 2025 14:59:29 +0100 Subject: [PATCH] question 9 --- main.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 8a2421a..e72a9ce 100644 --- a/main.py +++ b/main.py @@ -35,11 +35,19 @@ class TabletteChocolat: def demander_coup(self): rep = input("coup des lignes (l) ou colonnes (c)") if rep =="l": - i = int(input(f'choisi un nombre de 1 a {self.m} ')) - j = 0 + while True: + i = int(input("choisi un nombre de à ")) + j = 0 + if((i,j) in list(self.coups_possibles())): + break + else : - j = int(input(f'choisi un nombre de 1 a {self.n} ')) - i = 0 + while True: + j = int(input("choisi un nombre de à ")) + i = 0 + if((i,j) in list(self.coups_possibles())): + break + return (i,j) if __name__ == "__main__": -- GitLab