15 lines
278 B
Python
Executable File
15 lines
278 B
Python
Executable File
#!/usr/bin/python3
|
|
|
|
phrase = str(input("Entrez votre phrase : "))
|
|
tabmots = phrase.split(" ")
|
|
cptmots = {}
|
|
|
|
for mot in tabmots:
|
|
if not mot in cptmots:
|
|
cptmots[mot] = 1
|
|
else:
|
|
cptmots[mot] = cptmots[mot] + 1
|
|
|
|
for mot in cptmots.keys():
|
|
print(mot, ":", cptmots[mot])
|