Python “if” Statement with Multiple Conditions: Explained with Examples!

In this article let us learn how to implement if statement in Python with multiple condition evaluation For those of you in a hurry, here is the short version of the answer. “if” Statement with Multiple Conditions: Short Answer You can use the “and”/”or” logical operators in Python to implement “if” statements with multiple conditions. … Read more

Python’s [:] Notation Explained with Examples!

In this article let us learn about the commonly used “[:]” notation in Python, and learn how we can wield the power of this notation in our programs. For those of you in a hurry, here is the short version of the answer. The Short Version of The Answer Python’s “[:]” notation, officially known as … Read more

3 Ways to Handle KeyError Exceptions in Python

In this article let us learn what KeyError exceptions are, why they occur, how to prevent them from occurring and if they still occur then what are the crucial information we need to log for future debugging and how to log this information. In our journey to become a Proficient Python craftsman, we need to … Read more

Python Exception Tutorial: Printing Error Messages (5 Examples!)

In this article, let us learn about printing error messages from Exceptions with the help of 5 specifically chosen examples. I have divided this article into 2 major sections Printing custom error messages and Printing a specific part of the default error message. By “default error message“, I mean the error message that you typically … Read more

3 Ways to Catch Multiple Exceptions in a single “except” clause in Python!

To improve our craftsmanship as a Python programmer, we need to learn about handling exceptions effectively. One of the tricks to improving our efficiency while handle exceptions is to catch several exceptions using a single except clause. Python provides us with several ways to catch multiple Exceptions using a single except clause. In this article … Read more