In this video, we are going to learn more about the if statement, and we are going to use it with comparisons as well.
I have created a program that uses two variables, a String name, and a Boolean variable is_adult. I have also included an if statement to check if the is_adult variable is True. If the variable is True the program will print “Nick is an adult.” He can vote. Note that I have separated the if statement, this block of code, with two white lines. We can add as many white lines as we want, the program will just ignore them. I use them to separate blocks of code to make the program more readable.
Ok, the program works, it prints a message when the variable is True. But what if we wanted to print another message when the variable value was False.