This commit is contained in:
Debucquoy
2023-09-20 15:18:20 +02:00
parent 00d0cdfaf3
commit 4fd7542f03
228 changed files with 351 additions and 12 deletions

27
bac1/q1/27oct/ex6.py Normal file
View File

@ -0,0 +1,27 @@
def peut_retirer(i, bag, jeu):
"""verifie si une baguette peut etre retiree """
on_top = bag[:]
for intersection in jeu:
if intersection[1] in on_top:
on_top.remove(intersection[1])
return i in on_top
def retirer(i, bag, jeu):
bag.remove(i)
for intersection in jeu:
if i in intersection:
jeu.remove(intersection)
if __name__ == "__main__":
from ex5 import creer_mikado
bag = list(range(10))
game = creer_mikado(bag)
print(game)
retirer(5, bag, game)
print(game)
# print(bag)
# print(game)
# print(peut_retirer(5, bag, game))