How to properly ignore exceptions in Python?

Sometimes, we want to properly ignore exceptions in Python.

In this article, we’ll look at how to properly ignore exceptions in Python.

How to properly ignore exceptions in Python?

To properly ignore exceptions in Python, we can use the pass keyword in the except clause.

For instance, we write:

try:
    raise Exception()
except:
    pass

to create an empty except clause with pass.

Conclusion

To properly ignore exceptions in Python, we can use the pass keyword in the except clause.