Python
This commit is contained in:
13
sio2/sisr/20-python/Exercice3
Executable file
13
sio2/sisr/20-python/Exercice3
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/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])
|
||||
|
||||
|
Reference in New Issue
Block a user