The Tutorial we bring to you today is "Python programming series tutorial 5th about if statements": Generally, when you read other people's Python code, it may be found that this # _ * _ coding: UTF-8 _ * _ is to use Chinese in Python, specifying that the character set used by the current Python script is UTF-8 encoding. Python has three basic statements to control the process of the program. They are the if statement, for statement, and while statement. In the next course, we will introduce it one by one. Let's take a look at the first If statement. before talking about this, we should first learn another data type, called the bool type, to indicate true or false. It is used for judgment. True indicates True, False indicates False. For example, is Nana a puppy? If the result of this execution is True, I will use True to represent it. If it is False, we will use False to represent it. ALT + P = indicates that the value is assigned = indicates that the value is 5> 3. If the result is True, the if statement is used together with the else statement. If indicates If. If 5> 3, then we output a sentence. Else indicates otherwise, when the if condition judgment statement is False, the code block in else will be executed. Emphasize: the code is reduced. Now let's take a look at the reg. py registration script written in the previous lesson. We now add an item for it to allow users to enter the age. If the age is between 18 and 120, we assume that the age is valid and can be registered, otherwise, we will output a sentence to the user. Your age is invalid. Three logical operators And, or, not multi-branch selection structure IfElifElif... Else Xiao Ming exam score> 90 excellent 80-90 good between 70-80 medium below 70 difference