Question: In python Read text section 5.2 and review Section 3.4.3. Then answer the following a. Write a single line of code that will ask the
In python

Read text section 5.2 and review Section 3.4.3. Then answer the following a. Write a single line of code that will ask the user for a filename and store the resulting filename into a variable named filename. b. Write a single line of code that will open the file specified by the user in part a and store the file reference in a variable named myFile. c. Write a for loop and related code that will print just the first 5 characters of each line of the file you opened in part b. d. Write a single line of code that will close the file, indicating the program is finished using it
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
