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