In this tutorial, you'll learn about if-statements, using which you can do certain things only if certain conditions are met. In plain English, if-statements correspond to “Do this; then do that.” or “If this condition is true, perform this action; otherwise, do that action.”
A good way to visualize if-statements is flow charts. If-statements represent the yes / no questions in the flowchart below.
Before getting into if-statements, you'll first learn how to compare things in Python as well as the Boolean data type (values True and False). At the end of the lesson, you'll also see comments, which are useful for making your code more readable and easy to follow.