# import math def affiche_mots(chaine, n): for s in chaine.split(): print(s) if len(s) == n: break def affiche_mots_pas_5(chaine): return affiche_mots(chaine, n=5) def debute_par(s, prefix): compteur = 0 for mot in s.split(): if mot.startswith(prefix): compteur += 1 return compteur # print(math.pi) affiche_mots("la vie est belle", 3) affiche_mots_pas_5("la vieee est belle") print(debute_par("la vie est vbelle", "v"))