From 05e4c41cb3e912e19867f9c5adcdaa1b087722f3 Mon Sep 17 00:00:00 2001 From: ghostduck Date: Sat, 28 Jan 2017 17:38:26 +0800 Subject: [python3/en] Add examples to Bool operators with ints (#2639) --- python3.html.markdown | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit v1.2.3