Ajout du tp de python et regex

This commit is contained in:
2025-11-14 14:17:17 +01:00
parent 522b01ef35
commit b3721a511b
5 changed files with 75 additions and 0 deletions

View File

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