You are currently viewing Python Exceptions

Python Exceptions

Hello techies!! Welcome again in this domain on bittutech.com. Today I’m going to write an interesting blog post, I hope you all are very excited to read this blog post and give me your golden feedback to encourage my blogging skill.

Today’s blog post is fully dedicated to Some Common Exceptions of python programming language.

Exception Handling keywords
Exception Handling Keywords

Let’s start–:

What is an Exception?

Every programming language that we work with has some mechanism to handle an error that occurs during the program execution.

Technically, a runtime error is termed as an exception.

NameError–:

The exception raised when an identifier is not found in local and global reference.

TypeError–:

The exception raised when an operation or function is attempted that is invalid for the specified data type. Look at the below code snippet.

ValueError–:

The exception raised when a built operation or function receives an argument that has the right type but an inappropriate value.

ZeroDivisionError–:

This exception raised when division or module by zero takes place for all numeric types.

AttributeError–:

This exception raised when an object does not find an attribute.

KeyError–:

This exception raised when a mapping (dictionary) key is not found in the set of existing keys.

IndentationError–:

The exception raised due to incorrect Indentation.

IOError–:

The exception raised if the file requested can’t be opened or failure of I/O operation.

IndexError–:

The exception raised when an index is not found in sequence, out of range or out of bound.

ImportError–:

This exception raised when Python can’t find the module requested for in a program.

EOFError–:

The exception raised when one of the file method read() method, readline() method, readlines() method, tries to read beyond the file.

SyntaxError–:

This exception raised when there is an error in Python Syntax.

RuntimeError–:

The exception raised when an error doesn’t fall under any specific exception category defined above in the program.


Last words for this blog post-: So now, I am going to give some rest of my finger and charge again for new and interesting blog post for you till then, you all are read my other blog post. I hope you all are very excited to get something new. Don’t worry, we will meet very soon with a new and interesting blog post that absolutely enhance your technical skills and knowledge.

Share post

Prajjwal Singh

Tech Blogger || Web developer || Computer Networking Enthusiast || Microsoft SQL Database Management Expert || Software Debugger || Learned DOS OS Structure

Leave a Reply