def en_serpent(identifiant): resultat = "" for caractere in ...: if ...: ... += "_" + ... else: ... return ...