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