I have a list of words in a dictionary with the value = the repetition of the keyword but I only want a list of distinct words so I wanted to count the number of keywords. I
The number of distinct words (i.e. count of entries in the dictionary) can be found using the len() function.
len()
> a = {'foo':42, 'bar':69} > len(a) 2
To get all the distinct words (i.e. the keys), use the .keys() method.
.keys()
> list(a.keys()) ['foo', 'bar']