Changes Made:
I have added a Python solution for the "Wordcount" exercise, which includes three functions: print_words(), print_top(), and a helper function build_word_count_dict(). These functions allow users to analyze a text file and either print all words and their counts or print the top 20 most common words with their counts.
How to Use:
print_words(filename): Prints all words and their counts in sorted order.
print_top(filename): Prints the top 20 most common words and their counts in descending order.
Testing:
I have tested the code with various sample inputs and it produces the expected results.
Contributor Agreement:
By submitting this pull request, I confirm that I have read and agreed to the contributor agreement for this repository.
Description:
Changes Made: I have added a Python solution for the "Wordcount" exercise, which includes three functions: print_words(), print_top(), and a helper function build_word_count_dict(). These functions allow users to analyze a text file and either print all words and their counts or print the top 20 most common words with their counts.
How to Use: print_words(filename): Prints all words and their counts in sorted order. print_top(filename): Prints the top 20 most common words and their counts in descending order.
Testing: I have tested the code with various sample inputs and it produces the expected results.
Contributor Agreement: By submitting this pull request, I confirm that I have read and agreed to the contributor agreement for this repository.