# How to use the ‘except clause’ with No Exceptions in Python?

PythonServer Side ProgrammingProgramming

#### Beyond Basic Programming - Intermediate Python

Most Popular

36 Lectures 3 hours

#### Practical Machine Learning using Python

Best Seller

91 Lectures 23.5 hours

#### Practical Data Science using Python

22 Lectures 6 hours

If we define except clause with no exceptions, it can handle all types of exceptions. However, neither it’s a good coding practice nor it is recommended.

## Example

try:
print 'foo'+'qux'+ 7
except:
print' There is error'

## Output

You get the output

There is error

This type of Python try-except block can handle all types of exceptions, but it’ll not be helpful to the programmer to find which type of exception occurred.

Updated on 12-Feb-2020 11:21:05