SlideShare a Scribd company logo
3
Most read
4
Most read
5
Most read
EXCEPTION HANDLING IN
PYTHON
NAME: MIHIR BHARDWAJ
CLASS:MCA 2ND SEM
SUB :PYTHON
MUR:MUR2301439
TOPIC
 EXCEPTION
 EXCEPTION HANDLING
 TRY AND EXCEPT
 NESTED TRY BLOCK
 HANDLING MULTIPLE EXCEPTION IN SINGLE EXCEPT BLOCK
 RISING EXCEPTION
 FINALLY BLOCK
 USER DEFINED EXCEPTIONS
EXCEPTION
 Error caused by not following the proper structure(syntax) of the
language is called syntax error.
 Errors are also occur at runtime and these are called exception
 They occur, for example, when we try to open file and it not exist
(file not FoundError),dividing a number by Zero(Zero DivisionError).
 When ever these type of run error occour, python creates an
exception object.
EXCEPTION
Nested try Block
Raising Exceptions
 The raise statement in Python is used to raise an exception.
 The raise keyword is typically used inside a function or method, and is used to
indicate an error condition.
 We can throw an exception and immediately halt the running of your programme
by using the raise keyword.
Finally Block
 finally block is always executed after leaving the try statement. In case if some
exception was not handled by except block, it is re-raised after execution of finally
block.
 finally block is used to deallocate the system resources.
User define function
 Functions that we define ourselves to do certain specific task are referred as user-
defined functions.
 Functions that readily come with Python are called built-in functions.
EXCEPTION  HANDLING IN PYTHON For students .py.pptx

More Related Content

PDF
Exception Handling In Python | Exceptions In Python | Python Programming Tuto...
PDF
Python File Handling | File Operations in Python | Learn python programming |...
PPTX
Data file handling in python introduction,opening & closing files
PPTX
Iterarators and generators in python
PDF
Python programming : Inheritance and polymorphism
PDF
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
PPTX
Error and exception in python
PDF
Exception Handling In Python | Exceptions In Python | Python Programming Tuto...
Python File Handling | File Operations in Python | Learn python programming |...
Data file handling in python introduction,opening & closing files
Iterarators and generators in python
Python programming : Inheritance and polymorphism
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Error and exception in python

What's hot (20)

PDF
Python programming : Classes objects
PPTX
Introduction python
PPTX
CLASS OBJECT AND INHERITANCE IN PYTHON
PDF
Introduction To Python | Edureka
PPTX
Exception handling
PPTX
Conversion of Infix to Prefix and Postfix with Stack
PPTX
PYTHON FEATURES.pptx
PPSX
C lecture 4 nested loops and jumping statements slideshare
PPTX
Exception handling.pptx
PPSX
Modules and packages in python
PPTX
Java String
PPTX
Python Functions
PPT
File handling in C++
PPTX
Functions in Python
PPTX
Data Types, Variables, and Operators
PDF
Python exception handling
PPTX
L14 exception handling
PPTX
Python Exception Handling
PPTX
Chapter 13 exceptional handling
PPT
user defined function
Python programming : Classes objects
Introduction python
CLASS OBJECT AND INHERITANCE IN PYTHON
Introduction To Python | Edureka
Exception handling
Conversion of Infix to Prefix and Postfix with Stack
PYTHON FEATURES.pptx
C lecture 4 nested loops and jumping statements slideshare
Exception handling.pptx
Modules and packages in python
Java String
Python Functions
File handling in C++
Functions in Python
Data Types, Variables, and Operators
Python exception handling
L14 exception handling
Python Exception Handling
Chapter 13 exceptional handling
user defined function
Ad

Similar to EXCEPTION HANDLING IN PYTHON For students .py.pptx (20)

PPTX
Exception handling with python class 12.pptx
PPTX
exception handling.pptx
PPTX
Exception Handling.pptx
PPTX
Exception Handling in python programming.pptx
PDF
lecs101.pdfgggggggggggggggggggddddddddddddb
PPTX
Python Exception Handling (Python Course)
PPTX
Exception Handling in Python Programming.pptx
PPTX
Exception Handling in Python programming.pptx
PPTX
Python Exceptions Powerpoint Presentation
PDF
Python Programming - X. Exception Handling and Assertions
PDF
Exception handling in python
PPTX
Exception handling.pptxnn h
PPT
33aa27cae9c84fd12762a4ecdc288df822623524-1705207147822.ppt
PPTX
EXCEPTIONS-PYTHON.pptx RUNTIME ERRORS HANDLING
DOCX
Exception handlingpdf
PPTX
Errorhandlingbyvipulkendroyavidyalayacrpfmudkhed.pptx
PPT
Firoze_Errors_Exceptions in python__.ppt
PPTX
Python Lecture 7
Exception handling with python class 12.pptx
exception handling.pptx
Exception Handling.pptx
Exception Handling in python programming.pptx
lecs101.pdfgggggggggggggggggggddddddddddddb
Python Exception Handling (Python Course)
Exception Handling in Python Programming.pptx
Exception Handling in Python programming.pptx
Python Exceptions Powerpoint Presentation
Python Programming - X. Exception Handling and Assertions
Exception handling in python
Exception handling.pptxnn h
33aa27cae9c84fd12762a4ecdc288df822623524-1705207147822.ppt
EXCEPTIONS-PYTHON.pptx RUNTIME ERRORS HANDLING
Exception handlingpdf
Errorhandlingbyvipulkendroyavidyalayacrpfmudkhed.pptx
Firoze_Errors_Exceptions in python__.ppt
Python Lecture 7
Ad

Recently uploaded (20)

PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
Lecture Notes Electrical Wiring System Components
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
Geodesy 1.pptx...............................................
PDF
Digital Logic Computer Design lecture notes
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
Well-logging-methods_new................
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
additive manufacturing of ss316l using mig welding
Operating System & Kernel Study Guide-1 - converted.pdf
Lecture Notes Electrical Wiring System Components
Automation-in-Manufacturing-Chapter-Introduction.pdf
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Geodesy 1.pptx...............................................
Digital Logic Computer Design lecture notes
CYBER-CRIMES AND SECURITY A guide to understanding
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
OOP with Java - Java Introduction (Basics)
Foundation to blockchain - A guide to Blockchain Tech
Well-logging-methods_new................
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
additive manufacturing of ss316l using mig welding

EXCEPTION HANDLING IN PYTHON For students .py.pptx

  • 1. EXCEPTION HANDLING IN PYTHON NAME: MIHIR BHARDWAJ CLASS:MCA 2ND SEM SUB :PYTHON MUR:MUR2301439
  • 2. TOPIC  EXCEPTION  EXCEPTION HANDLING  TRY AND EXCEPT  NESTED TRY BLOCK  HANDLING MULTIPLE EXCEPTION IN SINGLE EXCEPT BLOCK  RISING EXCEPTION  FINALLY BLOCK  USER DEFINED EXCEPTIONS
  • 3. EXCEPTION  Error caused by not following the proper structure(syntax) of the language is called syntax error.  Errors are also occur at runtime and these are called exception  They occur, for example, when we try to open file and it not exist (file not FoundError),dividing a number by Zero(Zero DivisionError).  When ever these type of run error occour, python creates an exception object.
  • 6. Raising Exceptions  The raise statement in Python is used to raise an exception.  The raise keyword is typically used inside a function or method, and is used to indicate an error condition.  We can throw an exception and immediately halt the running of your programme by using the raise keyword.
  • 7. Finally Block  finally block is always executed after leaving the try statement. In case if some exception was not handled by except block, it is re-raised after execution of finally block.  finally block is used to deallocate the system resources.
  • 8. User define function  Functions that we define ourselves to do certain specific task are referred as user- defined functions.  Functions that readily come with Python are called built-in functions.