Remove checks that shouldn't be in a automate
This commit is contained in:
parent
5b5e4cd5bb
commit
98a6995f7c
1 changed files with 1 additions and 6 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue