def compteur(chaine, caractere): L = list(chaine) if caractere in L: L.pop(L.index(caractere)) return 1 + compteur(str(L), caractere) return 0