PCAP Exceptions and File I/O • Set 5
PCAP Exceptions and File I/O Practice Test 5 — 15 questions with explanations. Free, no signup.
What will be printed?
Refer to the exhibit.
Exhibit:
def parse_value(data):
try:
value = int(data)
return value
except ValueError:
return None
except TypeError:
return None
except:
return -1
result = parse_value('abc')
print(result)