Skip to Content

Python’s “>” and “>=” Operators: Explained Using 11 Examples

In this article let us learn about the “>” and “>=” operators in Python with the help of some examples and learn how to make use of this operator the same way the pros do! The first step in the journey towards mastery of any programming language is to learn about the various operators provided …

Read More about Python’s “>” and “>=” Operators: Explained Using 11 Examples

Python Comparison Operators Explained Using 10 Examples!

In this article let us look at all of the comparison operators in Python and learn how to use them in our programs! The first step in the journey towards mastery of any programming language is to learn about the various operators provided by that language and learn how to wield them. Python is no …

Read More about Python Comparison Operators Explained Using 10 Examples!

Figuring out if “break” was used to exit the loop in Python

In this short article let us see how we can figure out if the “break” statement was executed or not in the loop which has just been executed. Let us have a look at an example. In the example above, python will get an input from the user in each iteration, and if the user …

Read More about Figuring out if “break” was used to exit the loop in Python

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 about Python “if” Statement with Multiple Conditions: Explained with Examples!

Python “if” Statement: Checking if a condition is NOT true, Examples.

In this article let us learn how to implement the “if not” logic in our Python programs with the help of some examples! If you are in a hurry, here is the short version of the answer! The Short Version of the Answer In Python, depending on what we are trying to do, we can …

Read More about Python “if” Statement: Checking if a condition is NOT true, Examples.

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 about Python’s [:] Notation Explained with Examples!

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 about 3 Ways to Handle KeyError Exceptions in Python

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 about Python Exception Tutorial: Printing Error Messages (5 Examples!)