Python - Exception Handling Fundamentals
Consider this code:
What is the purpose of catching Exception as e here?
def read_file(filename):
try:
with open(filename) as f:
return f.read()
except Exception as e:
return str(e)
print(read_file('missing.txt'))What is the purpose of catching Exception as e here?
