ECS 10 Study Guide - Final Guide: Gnu Readline, Myc, Init

89 views26 pages

Document Summary

Direntry . path: the name of the direntry. Exceptions are a way of saying something out of the ordinary/ expected has happened: for example dividing by 0, trying to convert the string hello to an integer, accessing the 10th element of the list [1, 2, 3] If exception is raised and not handled by the programmer then the first program will crash. Some exceptions are recoverable and if they are our program should deal with them gracefully: maybe by trying again, maybe still ending the program but doing so in a nice way. Syntax: try: else: except exception_type1 as e1: code that could raise exception, code to handle exception finally, code to run if no exception happens, code you always want to run regardless of whether an exception happens or not. The first one that matches is the one that is run so it is like if elif.

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

Related Documents