Ajout du tp sur python

This commit is contained in:
2025-11-14 11:51:04 +01:00
parent ae750c11f7
commit 82b9787a10
5 changed files with 189830 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
#!/usr/bin/python3
chaine = str(input("saisir une chaine"))
tab = chaine.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])