User Tools

Site Tools


python_notes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
python_notes [2023/12/31 19:14] – [Chained comparisons] rajupython_notes [2023/12/31 19:54] – [Chained comparisons] raju
Line 172: Line 172:
 So ''3 < 4 == True'' is equivalent to ''3 < 4 and 4 == True'' which evaluates to ''True and False'' which turns out to be ''False''. So ''3 < 4 == True'' is equivalent to ''3 < 4 and 4 == True'' which evaluates to ''True and False'' which turns out to be ''False''.
  
-Ref:- https://docs.python.org/3/reference/expressions.html#comparisons+Ref:- 
 +  * https://docs.python.org/3/reference/expressions.html#comparisons - describes the above rule and also gives a list of comparison operators
  
 +==== List of comparison operators ====
 +<code>
 +"<" | ">" | "==" | ">=" | "<=" | "!="
 +| "is" ["not"] | ["not"] "in"
 +</code>
  
 ===== tasks ===== ===== tasks =====
python_notes.txt · Last modified: 2024/01/03 22:15 by raju