siotp/sio2/sisr/20-python/Exercice3
2021-09-29 11:15:21 +02:00

14 lines
237 B
Python
Executable File

#!/usr/bin/python3
phrase = input ("Phrase : ")
tabmot = phrase.split(' ')
cptmot = {}
for mot in tabmot :
if mot in tabmot:
cptmot [mot]=cptmot[mot] +1
else:
cptmot[mot]=1
for key in cptmot.keys():
print (key, " ",cptmot[key])