Question

Instructions: This lab will be done in EdStem workspace. Follow the ITEC136 Coding Convention for coding guidelines and styles. You will submit the lab here. Write a program that prompts

user to enter a filename. It read the file and prints a table of word frequencies. The words are in alphabetical order with the number of times each word occurs. The words are case insensitive. The words may have punctuation marks or other non-alphabetic characters. Use the remove_nonalphabet() function to remove any non- alphabetic characters before checking for the word frequencies. def remove_nonalphabet (msg): result for char in msg: = if char.isalpha(): result += char return result def word_frequencies (file_obj): # Implement the word_frequencies function. The file_obj function parameter is a file object. # Don't forget comment the code per the coding convention # The main program. Do not change it. if name filename file_object your_dictionary sorted_keys = == ___main__': input("Enter a filename: ") open (filename, "r") = word_frequencies (file_object) sorted(your_dictionary.keys()) = for key in sorted_keys: print (key + file_object.close() + str(your_dictionary[key])) Use the sample message.txt file to test your program. Note, the message.txt file is downloaded as zip file. Unzip it. Put it in the same directory where you write the program in EdStem Need code + comments.