1words = ['a', 'b', 'c', 'a']
2unique_words = set(words) # == set(['a', 'b', 'c'])
3unique_word_count = len(unique_words) # == 3
4
1aa="XXYYYSBAA"
2bb=dict(zip(list(aa),[list(aa).count(i) for i in list(aa)]))
3print(bb)
4# output:
5# {'X': 2, 'Y': 3, 'S': 1, 'B': 1, 'A': 2}
6