Notes || Python3 the Boolean expression conditional +

Boolean expression:

       Boolean: Features: There are only two cases --- True / False

                         1 -- True    False

                         2 -- type(True) ------------ <class 'bool'>

       Boolean expression: 1 --- its bool result

                              3 2 --- relational operators> == 1 equivalent of an equal sign is the assignment relationship is not equivalent to! =

                              3 --- compare strings: ① - it is more length? ---- invalid

                                                              ② - a string comparison is the ASCII value A --- 65 a ---- 97

                              4 --- logic operation

        Boolean result: 1 --- in the inside

                           2 --- not in not there

                           3 ---str   tuple   list

                           4 ---(1, 3) in (1, 3, 5) --------False

        Combination of conditions: 1 - --------- and Condition 1 and Condition 2

                             Wherein one of ① the entire expression = False False -----

                             ② If the condition 1 == True, conditions 2, will perform

                             ③ If the condition 1 == False, 2 conditions, will not perform

                          2 - or Condition 1 or Condition 2 ---------

                             ① - one of which is True ----- entire expression = True

                             ② - If the condition 1 == True, conditions 2, will not be executed

                             ③ - If the condition 1 == False, condition 2 will be performed

                          3 - not - not

                             ① negated True ---- False

                          4 - Priority

                             ① - without any parentheses case not> and> or

                             ② - the proposed multi-play brackets (3 (2 (1))) ------- from the inside out

                             ③ - complex logic -------- Advisory Notes

        

=============================================================================================================

Conditional:

       Flow Control: ① a step performed sequentially structure ----

                         ② selection structure ---- perform a selective step

                         ③ ---- loop structure under certain conditions, a piece of code has been executed

       Conditional: 1 - if - if the if condition == True: if the implementation of the statements inside

                         2 - if ... else ... if - else   

                                   ① only two cases, one of which will certainly be executed

                                   ② use the case of opposites

                         3 - multiple branches if .... elif ... else ...

                                   ① optional final else

                                   ② as long as one of the branches, exit if the sentence structure

                          4 - if the Nested

                                   ① to be executed if the interior must be outside if it can meet

                                   ② equivalent and

                          5 - switch statement ------------ Without this syntax

                          6 - multiple conditional branches can write

                          7-- comment / uncomment ctrl + /

                          8 - Extended:

                                    ① - if followed, if the value is non-empty string, a non-empty tuples, non-empty list is not 0, with the proviso that if the result is True

                          9 - input () - function - receiving string - returns a string

                           if statement as long as one code block is terminated if the entire

        

Guess you like

Origin www.cnblogs.com/peipei-Study/p/11904508.html