mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
[python3/en] Bool operators
Bool operators
This commit is contained in:
parent
62f4c0de22
commit
820eebcd33
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user