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
len(yourdict.keys())
or just
len(yourdict)
If you like to count unique words in the file, you could just use set and do like
len(set(open(yourdictfile).read().split()))