Question: You must write this assignment starting with Template for Functions {chapter 51-}.py. Refer to the Style Requirementsprlf document posted in Blackboard for more requirements. Data



You must write this assignment starting with Template for Functions {chapter 51-}.py. Refer to the Style Requirementsprlf document posted in Blackboard for more requirements. Data les will be supplied with these instructions. Use Template for Libraries {chapter 5+).py for writing modules that will be imported. The Problem Write a file named FinalExam.py with a main program that imports the library module FinalExamFunctions.py and calls the sentence prooessing function [described below] as long as the user says they want to oontinue. Build a library module named FinalExamFunctions.py with the 3 functions described below. Global constants: build a tuple named ALP HABEr, including both lowercase and uppercase letters, i.e., ALPHABET = tuplel: ['a', 'b', ...,'2, 'A', '3', 'z'] :I. Make sure the lowercase letter are first in the list. Also use a global constant for the default data file name, which is "characters.txt". Write a sentence prooessingfunction that passes the default file name to a le reading function and receives a buffer list in return. It then passes that list to the list processing function and reoeives a sentenoe list in return. Finally, the sentence processing function prints the sentence list one item at time with a space between the list items. Write a le reading function that tries to open the le named in the parameter and read le of numbers into a list named buffer. Use a general purpose exception to handle any error: if there is ANY error, simply leave the buffer list empty. Finally, return the list. Write a list processing function which receives a list as a parameter and loops through the list doing the following: convert each list element to integer and use the value as an index ofALP HABEf to get a character, which it ooncatenates to a string named thisWo rd. If the oonversion or index step generates ANY error, append the thisWord to a list named sentence [but only if thisWord is not an empty string at that point] and then empty thisWord before continuing to loop through the buffer list. When the loop reaches the end of the list, he sure the last word is also concatenated to the sentence list. After the sentence list is built, return the sentence list to the sentence processing function. Extra credit (10 points) Build another global oonstant tuple of punctuation symbols that you will accept ['.', ',', ';', '?', and so on -- you decide]. If a list item causes an error in the list processing function, catch it with the exception as described above, but test to see if it is in the punctuation list. If it is, append the punctuation to the word before proceeding to append the word to the sentence list. Extra credit ('70 points] Add a function to the library that allows you to type a string which will use the alphabet tuple to write the index of your typed characters, one at a time, to build a data file named "characters.txt" that can be read by the sentence processing function. The input is typed as a sentence, not as single words, or characters, at a time. Modify the main program to offer a menu choice: call the typing function, call the sentence processing function, or quit. Continue offering this choioe until the user chooses to quit. ~ Template for Functions (chapter 5+).py - C:\\Users\\priya\\Downloads\\Template for Functions (chapter 5+).py (3.10.0) File Edit Format Run Options Window Help Program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
