Question: Python: Implement a function read text file(name) that takes the name of a text file as input and reads each line of text into a
Python:
Implement a function read text file(name) that takes the name of a text file as input and reads each line of text into a string, returning a list of strings associated to the file (i.e., the function converts the text in the file into a list of strings). Please make sure you close the file after reading it (by, for example, attempting to read the file after calling the function and ensuring an exception is thrown).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
