CS 1110 Lecture Notes - Lecture 1: Nanosecond, Tooth Brushing, Toothache

57 views5 pages

Document Summary

17. 2) exception handling: a way of dealing with errors you can"t really account for in your code. If someone pulls usb drive in the middle of file transfer: most basic syntax of tryexcept clause. raise an exception, python jumps to and executes those, then the program continues afterward as normal. If no exceptions are raised during execution of , are skipped: you can use multiple excepts to handle multiple exceptions. In this way, it"s a lot like the ifelifelifelse clause. Never try to capture an exception and then just ignore it: basically, all exceptions should either be handled responsibly, or should just make the program crash. Lecture notes: how to brush your teeth. Exceptional control flow: there are exceptions in brushing teeth, empty paste, toothache, no batteries in electric brush, most any step of the way, we can imagine something going wrong. Instead of blowing up, and also keeps program running.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents