Exercices Python

This commit is contained in:
IDEZ Ugo
2021-09-29 11:27:23 +02:00
parent 34c54eea8c
commit 7e1a478b23
3 changed files with 50 additions and 0 deletions

15
sio2/sisr/python/ex3.py Executable file
View File

@@ -0,0 +1,15 @@
#!/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 cle in cptmot.keys():
print(cle, cptmot[cle])