16 lines
251 B
Python
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])
|