Introduction to Computing Using Python: An Application Development Focus by Ljubomir Perkovic
Author:Ljubomir Perkovic [Ljubomir Perkovic]
Language: eng
Format: epub, pdf
Tags: Python
Publisher: John Wiley & Sons
Published: 2011-12-19T16:00:00+00:00
Compare this to the execution shown in Figure 7.10, when the default exception handler handled the exception.
In the previous example, we chose to implement an exception handler at the point where function f(2) is called. This represents a design decision by the developer of function f() that it is up to the function user to worry about handling exceptions.
In the next example, the developer of function h makes the design decision that function h() should handle any exception that occur during its execution. In this example, the function h() is modified so that its code is inside a try block:
Module: stack2.py
1 def h(n): 2 try: 3 print(‘Start h’) 4 print(1/n) 5 print(n) 6 except: 7 print(‘Caught!’)
Download
Introduction to Computing Using Python: An Application Development Focus by Ljubomir Perkovic.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Coding Theory | Localization |
Logic | Object-Oriented Design |
Performance Optimization | Quality Control |
Reengineering | Robohelp |
Software Development | Software Reuse |
Structured Design | Testing |
Tools | UML |
Deep Learning with Python by François Chollet(12105)
Hello! Python by Anthony Briggs(9511)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9483)
The Mikado Method by Ola Ellnestam Daniel Brolund(9436)
Dependency Injection in .NET by Mark Seemann(8987)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(7973)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7512)
Grails in Action by Glen Smith Peter Ledbrook(7409)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7230)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6105)
Kotlin in Action by Dmitry Jemerov(4761)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(4388)
Microservices with Go by Alexander Shuiskov(4121)
Practical Design Patterns for Java Developers by Miroslav Wengner(4035)
Test Automation Engineering Handbook by Manikandan Sambamurthy(4004)
Practical Vim (for Kathryn Amaral) by Drew Neil(3802)
Cracking the GRE Premium Edition with 6 Practice Tests, 2015 (Graduate School Test Preparation) by Princeton Review(3679)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3677)
Learn SOLIDWORKS 2020 by Tayseer Almattar(3573)