a=False while not a: try: f_n = input("Enter file name") i_f = open(f_n, 'r') except: print("Input file not found")
a) No error
b) Assertion error
c) Input output error
d) Name error
a=False while not a: try: f_n = input("Enter file name") i_f = open(f_n, 'r') except: print("Input file not found")
a) No error
b) Assertion error
c) Input output error
d) Name error
You must be logged in to post a comment.
a
Explanation: In the code shown above, if the input file in not found, then the statement: “Input file not found” is printed on the screen. The user is then prompted to reenter the file name. Error is not thrown.