Conditional judgment if else syntax ruleIfIfStatement is judged asTrue,It will execute the following sub-code< Span style= "FONT-FAMILY:SIMSUN; font-size:12pt; Color: #000000; Font-style:normal; Font-variant:normal; " >< Span style= "Font-family:cambria; font-size:12pt; Color: #000000; Font-style:normal; Font-variant:normal; " > ( Otherwise, execute the sub-code below the El se. Of course, back.El SE not necessarily. and and or grammar rules
Look here write if user_input = = Valid_user and passwd = = valid_passwd:& #0, meaning that if condition must satisfy 2 conditions at the same time, of course, you can also
Then write 1 and, 2 and ... n and, the IF condition must satisfy n conditions to execute the syntax below it, but the normal person does not write & #0; too many and, because the readability is too poor. So a general if judgment satisfies 1 to 3 conditions at the same time; the grammar corresponding to and is either, "or" means, and is the meaning of "with", that is, satisfies 1 or another 1 or 1 conditions ... Conditional Judgment Elif Grammar rules
elif means that if the first if condition is not met, the program will continue to go down and then determine whether the elif condition is met. If not, just keep going (here you can add moreElifJudgment), as soon as it encounters a< Span style= "font-family:menlo-regular; font-size:10pt; Color: #000000; Font-style:normal; Font-variant:normal; " >< Span style= "FONT-FAMILY:SIMSUN; font-size:10pt; Color: #000000; Font-style:normal; Font-variant:normal; " >< Span style= "FONT-FAMILY:SIMSUN; font-size:10pt; Color: #000000; Font-style:normal; Font-variant:normal; " >< Span style= "FONT-FAMILY:SIMSUN; font-size:10pt; Color: #000000; Font-style:normal; Font-variant:normal; " If the final condition is not met, the final line Elif can write multiple lines
Python's Way "first": Python Basics (6)