What are the Python logical operators?

There are three kinds of and, or, not in Python logical operators

【1】and logic: "Two truths are true to be true"--true

true and true ---true --- two true is true
true  and  false ---false
false and false ---false
false and  true  ---false

Use case diagram:


【2】or logic: "Two false is false is false"---false

true  or  true   ---true
true  or  flase  ---true
flase or  true   ---true
flase or flase ---flase --- two false is false is false

Use case diagram:


【3】not logic: "True becomes false and false becomes true"
not true ---falas --- true to false
not falas ---true ---false becomes true

Priority level in operation: () >not >and >or

 

 

Guess you like

Origin blog.csdn.net/qq_44361142/article/details/127007346