mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-15 11:14:24 +02:00
[python3/en] Bool operators
Bool operators
This commit is contained in:
@@ -66,11 +66,12 @@ not False # => True
|
|||||||
True and False #=> False
|
True and False #=> False
|
||||||
False or True #=> True
|
False or True #=> True
|
||||||
|
|
||||||
# Note with ints
|
# Note using Bool operators with ints
|
||||||
0 and 2 #=> 0
|
0 and 2 #=> 0
|
||||||
-5 or 0 #=> -5
|
-5 or 0 #=> -5
|
||||||
0 == False #=> True
|
0 == False #=> True
|
||||||
2 == True #=> False #only 1 == True #=> True
|
2 == True #=> False
|
||||||
|
1 == True #=> True
|
||||||
|
|
||||||
# Equality is ==
|
# Equality is ==
|
||||||
1 == 1 # => True
|
1 == 1 # => True
|
||||||
|
Reference in New Issue
Block a user