From 62f4c0de22452177d96ba24ce0cf8cce119af47b Mon Sep 17 00:00:00 2001 From: Steven Basart Date: Sun, 7 Sep 2014 19:22:01 -0400 Subject: [python/en] Added Bool operators Bool operators --- python.html.markdown | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'python.html.markdown') 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 -- cgit v1.2.3 From 81b4f49e999a6ec41bd1f79d77208d2db0a29871 Mon Sep 17 00:00:00 2001 From: Steven Basart Date: Sun, 7 Sep 2014 19:32:46 -0400 Subject: [python/en] Added Bool operators Modified Bool operators --- python.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python.html.markdown') diff --git a/python.html.markdown b/python.html.markdown index 6b2a40de..390c7b76 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -62,7 +62,7 @@ to Python 2.x. Look for another tour of Python 3 soon! +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 -- cgit v1.2.3