ajout code .py
This commit is contained in:
13
sio2/sisr2/30-Python/ex3.py
Normal file
13
sio2/sisr2/30-Python/ex3.py
Normal file
@@ -0,0 +1,13 @@
|
||||
txt=str(input('écrivez :'))
|
||||
|
||||
tabmot=txt.split(" ")
|
||||
cptmot= {}
|
||||
|
||||
for mot in tabmot:
|
||||
if not mot in cptmot:
|
||||
cptmot[mot]=1
|
||||
else:
|
||||
cptmot[mot]=cptmot[mot]+1
|
||||
|
||||
for mot in cptmot.keys():
|
||||
print (mot,":",cptmot[mot])
|
||||
Reference in New Issue
Block a user