s = 'i am very very like you and like you' dict( [(i, s.split().count(i)) for i in s.split()] ) Out[2]: {'i': 1, 'am': 1, 'very': 2, 'like': 2, 'you': 2, 'and': 1} set( map(lambda x:(x, s.split().count(x)), s.split()) ) Out[6]: {('am', 1), ('and', 1)