Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
189080c510 |
15
sio2/sisr/20-python/cptmot.py
Normal file
15
sio2/sisr/20-python/cptmot.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/lib/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])
|
||||||
|
|
Reference in New Issue
Block a user