Question: 00:21 solution.py Read data from keyboard and save in file Given a file name FN. Read data from a keyboard and store it in a

 00:21 solution.py Read data from keyboard and save in file Given

00:21 solution.py Read data from keyboard and save in file Given a file name FN. Read data from a keyboard and store it in a file. Write a function: def solution(FN): that accepts file name FN. The function should read keyboard input till an empty line is entered. Store input data in a a file Input This is file read example in Python where, First line represents a file content Output This is file read example in Python solution.py 1 import os, errno 2 def solution(FN): 3 Write your code here. 4 filename = 'filename.txt" 5 solution(filename) 6 f = open(Filenand, "r") 7 text - f.read() 8 print(text) 9. try: 10 os.remove(filename) 11. except OSError: 12 pass + Test Case(s) + Grading Criteria + Add custom Testace

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!