summaryrefslogtreecommitdiffhomepage
path: root/python.html.markdown
diff options
context:
space:
mode:
authorSteven Basart <xksteven@users.noreply.github.com>2014-09-07 19:22:01 -0400
committerSteven Basart <xksteven@users.noreply.github.com>2014-09-07 19:22:01 -0400
commit62f4c0de22452177d96ba24ce0cf8cce119af47b (patch)
tree463e666055f19599592af8b7b1d9196ac21d7303 /python.html.markdown
parent9a909d6a4a1083a97b54c50de2fb390e76f879c0 (diff)
[python/en] Added Bool operators
Bool operators
Diffstat (limited to 'python.html.markdown')
-rw-r--r--python.html.markdown14
1 files changed, 11 insertions, 3 deletions
diff --git a/python.html.markdown b/python.html.markdown
index 9057dde2..6b2a40de 100644
--- a/python.html.markdown
+++ b/python.html.markdown
@@ -57,9 +57,17 @@ to Python 2.x. Look for another tour of Python 3 soon!
# Enforce precedence with parentheses
(1 + 3) * 2 # => 8
-# Boolean values are primitives
-True
-False
+# Boolean Operators
++# Note "and" and "or" are case-sensitive
++True and False #=> False
++False or True #=> True
++
++# Note with ints
++0 and 2 #=> 0
++-5 or 0 #=> -5
++0 == False #=> True
++2 == True #=> False
+1 == True #=> True
# negate with not
not True # => False