Ajout du tp python et du regex

This commit is contained in:
2025-11-14 10:39:53 +00:00
parent 3ecc7adfe2
commit 539f09b460
5 changed files with 189817 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
#!/usr/bin/python3
phrase = str(input("Entrez une phrase : "))
tab = phrase.split(' ')
cpt_mot = {}
for mot in tab:
if mot in cpt_mot:
cpt_mot[mot] = cpt_mot[mot] + 1
else:
cpt_mot[mot] = 1
for key in cpt_mot.keys():
print(key, " ", cpt_mot[key])