summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorghostduck <ghostduck@users.noreply.github.com>2017-01-28 17:38:26 +0800
committerven <vendethiel@hotmail.fr>2017-01-28 10:38:26 +0100
commit05e4c41cb3e912e19867f9c5adcdaa1b087722f3 (patch)
treeb2f882f211003d0ec38550747ee576ebae446e02
parent20b2a9a29d485a52b8ab455b6b0fae65678174ef (diff)
[python3/en] Add examples to Bool operators with ints (#2639)
-rw-r--r--python3.html.markdown3
1 files changed, 3 insertions, 0 deletions
diff --git a/python3.html.markdown b/python3.html.markdown
index 3821d84f..02745117 100644
--- a/python3.html.markdown
+++ b/python3.html.markdown
@@ -71,11 +71,14 @@ True and False # => False
False or True # => True
# Note using Bool operators with ints
+# False is 0 and True is 1
+# Don't mix up with bool(ints) and bitwise and/or (&,|)
0 and 2 # => 0
-5 or 0 # => -5
0 == False # => True
2 == True # => False
1 == True # => True
+-5 != False != True #=> True
# Equality is ==
1 == 1 # => True