Question: Select a wrapper function safeOpen() for the open()function. Recall that when open() is called to open a file that doesn't exist in the current working

Select a "wrapper" function safeOpen() for the open()function. Recall that when open() is called to open a file that doesn't exist in the current working directory, an exception is raised: > > > safeOpen('ftest.py",r') def safeOpen(filename, mode): try: infile = open(filename, mode) return infile except: return None def safeOpen(filename, mode): try: infile = open(filename, mode) return filename except: return infile def safeOpen(mode): try: infile = open (filename, mode) return infile except: return infile
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
