Skip to Content
Python 3 Object-Oriented Programming - Second Edition
book

Python 3 Object-Oriented Programming - Second Edition

by Dusty Phillips
August 2015
Beginner to intermediate
460 pages
11h 20m
English
Packt Publishing
Content preview from Python 3 Object-Oriented Programming - Second Edition

Exercises

If you've never dealt with exceptions before, the first thing you need to do is look at any old Python code you've written and notice if there are places you should have been handling exceptions. How would you handle them? Do you need to handle them at all? Sometimes, letting the exception propagate to the console is the best way to communicate to the user, especially if the user is also the script's coder. Sometimes, you can recover from the error and allow the program to continue. Sometimes, you can only reformat the error into something the user can understand and display it to them.

Some common places to look are file I/O (is it possible your code will try to read a file that doesn't exist?), mathematical expressions (is it possible ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python 3 Object-Oriented Programming - Third Edition

Python 3 Object-Oriented Programming - Third Edition

Dusty Phillips

Publisher Resources

ISBN: 9781784398781Supplemental Content