• + 0 comments

    Use OrderedDict to preserve the order of input words. Loop over input lines, setting each word's count to zero initially. Update each word's count as it appears. Finally, print the count of unique words and their occurrences.