1. BVRIT HYDERABAD College of Engineering for Women
Python Programming
By
M Dyva Sugnana Rao
Asst. Professor
Department of Computer Science and Engineering
2. BVRIT HYDERABAD College of Engineering for Women
Name of the Course Python Programming
Course Code CS601PC
Year & Semester B.Tech VI Year I Sem
Section CSE - A
Name of the Faculty M Dyva Sugnana Rao
Lecture Hour | Date 02 | 14 December 2020
Name of the Topic Exception Handling
Course Outcome(s) How to handle exceptions
3. Exception Handling
Syntax Error:
As the name suggest this error is caused by wrong
syntax in the code.
Exceptions:
An exception is an event, which occurs during the
execution of a program that disrupts the normal flow of
the program's instructions.
4. Exceptions in Python
• Python has many built-in exceptions that are raised when your
program encounters an error .
• Exception is the base class for all the exceptions in Python
5. Catching Exceptions in Python
• Exceptions can be handled using a try .
• Code that handles the exceptions is written in the except clause.
• try:
print(x)
except:
print("An exception occurred")