Exception handling
Upcoming SlideShare
Loading in...5
×
 

Exception handling

Exception handling

Statistics

Views

Total Views
251
Views on SlideShare
251
Embed Views
0

Actions

Likes
0
Downloads
1
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Exception handling Exception handling Presentation Transcript

  • Disclaimer: This presentation is prepared by trainees ofbaabtra as a part of mentoring program. This is not officialdocument of baabtra –Mentoring PartnerBaabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt .Ltd
  • EXCEPTION HANDLING SHEETHAL U sheethu@gmail.com www.facebook.com/sheethu in.linkedin.com/in/sheethal Ummanath 9447531524
  • If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance.www.baabtra.com | www.massbaab.com |www.baabte.com
  • EXCEPTION Exceptions are events that can modify the flow or control through a program. They are automatically triggered on errors. try/except : catch and recover from raised by you or Python exceptions try/finally: perform cleanup actions whether exceptions occur or not raise: trigger an exception manually in your code
  • • An exception is an event, which occurs during the execution of a program, that disrupts the normal flow of the programs instructions.• In general, when a Python script encounters a situation that it cant cope with, it raises an exception.
  • • If you have some suspicious code that may raise an exception, you can defend your program by placing the suspicious code in a try: block.• After the try: block, include an except: statement, followed by a block of code which handles the problem as elegantly as possible.
  • syntax• try: You do your operations here; ......................except ExceptionI: If there is ExceptionI, then execute this block.except ExceptionII: If there is ExceptionII, then execute this block. ......................else: If there is no exception then execute this block.
  • Contact Us