Exception handling
Upcoming SlideShare
Loading in...5

Like this? Share it with your network


Exception handling

Exception handling



Total Views
Views on SlideShare
Embed Views



0 Embeds 0

No embeds



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.

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

Exception handling Presentation Transcript

  • 1. 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
  • 2. EXCEPTION HANDLING SHEETHAL U sheethu@gmail.com www.facebook.com/sheethu in.linkedin.com/in/sheethal Ummanath 9447531524
  • 3. 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
  • 4. 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
  • 5. • 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.
  • 6. • 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.
  • 7. 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.
  • 8. Contact Us