[Solved]03 Wordfrequency Py 40 Points Write Program Reads Contents Text File Program Create Dictio Q37099416
please write in python
03) WordFrequency-py (40 Points) Write a program that reads the contents of a text file. The program should create a dictionary in which the keys are the individual words found in the file and the values are the number of times each word appears. For example, if the word “the” appears 28 times, the dictionary would contain an element with the’ as the key and 28 as the value. Display the dictionary on the command line/Terminal. The program should write the word and its frequency to a different file WordFreq.txt Imagine the input file data.txt contains the following text, Baseball is a sport that dates back as far as 1744 and formats of the game have been in place until the modern era today. The game is predominantly big in North America, Canada and Japan. The game is played worldwide with the pinnacle of sport coming from the World Series of Basebal1. Ironically this event is only competed by North American teams The output file should contain back baseball 2 dates far formats 1 game north place sport the Total number of words62 . Prompt the user for input file. If the input file doesn’t exit, display a message “Input file not found. Please re-enter.” Allow the user to enter the file name one more time. If the user enters it incorrectly, then terminate the program. Use try…except logic. Remove punctuation marks at the end of the words to get the actual word If the input file contains numbers (integers or floating point), the program should ignore those. . . The’ and the’ should be considered as same. Meaning, convert all words into lowercase. . The output file should display the frequency in the alphabetical order Show transcribed image text 03) WordFrequency-py (40 Points) Write a program that reads the contents of a text file. The program should create a dictionary in which the keys are the individual words found in the file and the values are the number of times each word appears. For example, if the word “the” appears 28 times, the dictionary would contain an element with the’ as the key and 28 as the value. Display the dictionary on the command line/Terminal.
The program should write the word and its frequency to a different file WordFreq.txt Imagine the input file data.txt contains the following text, Baseball is a sport that dates back as far as 1744 and formats of the game have been in place until the modern era today. The game is predominantly big in North America, Canada and Japan. The game is played worldwide with the pinnacle of sport coming from the World Series of Basebal1. Ironically this event is only competed by North American teams The output file should contain back baseball 2 dates far formats 1 game north place sport the Total number of words62 . Prompt the user for input file. If the input file doesn’t exit, display a message “Input file not found. Please re-enter.” Allow the user to enter the file name one more time. If the user enters it incorrectly, then terminate the program. Use try…except logic. Remove punctuation marks at the end of the words to get the actual word If the input file contains numbers (integers or floating point), the program should ignore those. . . The’ and the’ should be considered as same. Meaning, convert all words into lowercase. . The output file should display the frequency in the alphabetical order
Expert Answer
Answer to 03) WordFrequency-py (40 Points) Write a program that reads the contents of a text file. The program should create a dic… . . .
OR

