Computer Science 15-112, Fall 2013
Class Notes:  Exceptions


  1. Handling Exceptions (try/except)
    print "This is a demonstration of the basics of try/except."
    try:
        print "Here we are just before the error!"
        print "1/0 equals:", (1/0)
        print "This line will never run!"
    except:
        print "*** We just caught an error. ***"
    print "And that concludes our demonstration."
  2. Optional:  More on Exceptions
    See these notes.

carpe diem   -   carpe diem   -   carpe diem   -   carpe diem   -   carpe diem   -   carpe diem   -   carpe diem   -   carpe diem   -   carpe diem