198
edits
Changes
→Create a Python Script Which Handles Errors
print(add('10',5)) # works
print(add('abc',5)) # exception
print(read_file('seneca1seneca2.txt')) # works
print(read_file('file10000.txt')) # exception
15
error: could not add numbers
['Line 1\n', 'Line 2 is a little longer\n', 'Line 3 is too\n', 'This is the forth line\n', 'Final line in file\n']
error: could not read file
</source>
'error: could not add numbers'
lab5c.read_file('seneca1seneca2.txt')['Line 1\n', 'Line 2 is a little longer\n', 'Line 3 is too\n', 'This is the forth line\n', 'Final line in file\n']
lab5c.read_file('file10000.txt')