Files
siotp/sisr2/sisr/35-python/occurence.py
2025-11-14 11:51:04 +01:00

16 lines
251 B
Python

#!/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])