Question: Return values must be assigned to variables before used. Please follow all the directions and code using Python idle and make sure not to use

 Return values must be assigned to variables before used. Please followall the directions and code using Python idle and make sure not

Return values must be assigned to variables before used.

Please follow all the directions and code using Python idle and make sure not to use the constructs prohibited in the list unless the question at the top asks you to use that construct.

This purpose of this comprehensive program is 1. to become comfortable with the constructs we have learned so far including function, iterations, conditionals, lists, and files. 2. to identify any gaps in your learning and the concept. Problem Description - Your task is write the following functions: 1. create_file - takes filename as a parameter. The function creates an empty file. 2. read_file - takes filename as a parameter and returns a string with file content. 3. read_file_lines - This function takes filename as a parameter. and returns a list whose elements are representative of the lines in the file. - Example, if a file contains: iam writing this program The output should be as follows: => ["I am writing", "this program"] 4. write_to_file - takes filename and a list as a parameter. This function overwrites the file using list elementby-element where each element is on the newline into the file. It is necessary to check if the list is empty before start inserting elements to file. If the list is empty, print "list is empty" and perform no operations. 5. append_to_file - takes filename and a list as a parameter. This function writes the entire list element-byelement into the file. It is necessary to check if the list is empty before start inserting elements to file. - Executing/Running and testing your code for robustness is essential. Therefore, I would recommend you to create main function and invoke your functions under various different scenarios. This would help you ensure the integrity of the code. directions. Using the following constructs will result in 0 (zero) for the entire submission (assignment, timed test, etc.). The restricted items are as follows: - Concepts not discussed in lectures yet - String functions - Member functions - Exceptions (can use) : /en () and x=x+[y1,y2,y3] - Built-in functions \& types - Exceptions (can use): str( ), readline( ), open(), close( ), write(), read(), range( ), .split() - Cannot use .append, .sort, etc. - Cannot use "Slicing" - Cannot use "list comprehension" - Cannot use "not in" (together) - Cannot use "in" - not allowed with conditionals - Exception (can use): with range () - Cannot use and \{\} - Exception (can use): mathematical operations (multiply \& exponents) - Data type functions - Exceptions (can use): int (), str (), float () - Break - Continue - Nested Constructs - Exceptions (can use): 2-D list - Multiple returns \& Multiple assignments - Recursion (not allowed unless the question explicitly states otherwise) - Functions within functions (Definitions) -- invocation is fine - Default Parameters - Global variables - Keyword as variable names

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!