Remove checks that shouldn't be in a automate

This commit is contained in:
flyingscorpio@arch-desktop 2021-10-05 21:15:39 +02:00
parent 5b5e4cd5bb
commit 98a6995f7c

View file

@ -27,16 +27,11 @@ def automate_modulo_7(nombre: str) -> bool:
(3, 4), # état 5
(5, 6), # état 6
]
etat_courant = 0
etat_courant = 0 # état initial
for chiffre in nombre:
if chiffre not in ("0", "1"):
raise ValueError(f"{nombre} doit être binaire")
etat_courant = etats[etat_courant][int(chiffre)]
if etat_courant == 0:
return True
return False