#!/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])