Question: Write a program to open the file jinglebells.txt and read it line by line. For each line, split the line into a list of words
Write a program to open the file jinglebells.txt and read it line by line. For each line, split the line into a list of words using the split function. Create a new dictionary called song. Add to the dictionary the following dictionary pairs (key/values): a. Add the words from the list as keys in the dictionary. b.The values will be the number of times the word appears in the list (histogram) Sort the keys alphabetically. Print the keys and values for the words that appear 3 or more times.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
