 Up until now, we haven't been able to test for conditions. When we ask a person for their age in years, as in this program, if they enter a negative number, we do the calculation anyway, even though it doesn't make any sense. We'd like a way to tell if input is valid before we do the calculation. And that's why Python has the if statement, which has this generic model. If some boolean expression evaluates to true, we do some statements. This is called the if clause. Otherwise, the expression worked out to false. We do the other statements, and that's the else clause. The if clause and else clause are always indented under the if and else keywords. This is called a binary if. That's a bit abstract, so let's put a binary if into our age program. After we get the number of years, we're going to ask if the years is greater than zero, then it's okay to do our calculation of the number of days and print that out. Otherwise, years was not greater than zero, we'll print an error message. Now let's run the program. If we give a positive age, we get a number back. If we have a negative number, we get our error message. In most cases, you're going to have an else to go along with your if. You'll want to do one thing or some other thing. Sometimes, though, you'll want to have an if part only without an else to go with it. And that's called a unary selection one way as opposed to this binary selection, which is a two-way if else. Let's add some code to ask for the user's name and print it in the output. We'll let name become input, and the prompt will be what is your name. And here in the print, we'll add the name to personalize our output. If someone named Nancy is 41 years old, we get their age and days. What happens if I just press enter? I don't want to give my name. And then give an age. I get output like this. You are about 10,585 days old, comma, period. That's sort of ugly. Let's put in a unary selection to provide a name if the user hasn't given us one. If the name is equal to the empty string. And notice by the way I'm using two equal signs here. Remember, a single equal sign is the assignment operator. A double equal sign asks a question. Our name and the empty string the same. That's a yes or no, true or false question. If the answer is true, then we'll change the name to mystery guest. We don't need an else. If the name wasn't the empty string, it's the name that they entered, and that's the one we want to use. Let's run the program again. This time let's have Fred, who's 19 years old, and we get his name. If we run it with someone who doesn't want to give their name, who's also 19, we call them mystery guest. The output is a little more humorous, and at least not as ugly as it was before. Some people like to have an else with their if, no matter what. If you're one of those people and you insist on having an else for every if, Python has a construct for you. In this unary if, I can say else, and the body of the else clause will be pass. That's a special keyword in Python that means do nothing. These lines now tell us if the name is the empty string, I'll set the name to mystery guest. Otherwise, I'll pass right on to the rest of the program. Nothing to do here. And this also works. If someone named Vin is 22 years old, it uses their name, and if someone doesn't give a name and they're 22 years old, they become our mystery guest. In summary, there are two types of if statements. One is the binary if with else, where you have two choices. If the condition is true, you do one thing. Otherwise, you do something else. The other kind is the unary selection. If the name is the empty string, we'll set it to mystery guest. Otherwise, there's nothing to be done and we don't even need the else part. However, if you do want to have an else part for every if, you can always use pass to tell Python do nothing.