diff --git a/guide/english/python/boolean-operations/index.md b/guide/english/python/boolean-operations/index.md index 06441b4529..a44a415070 100644 --- a/guide/english/python/boolean-operations/index.md +++ b/guide/english/python/boolean-operations/index.md @@ -31,7 +31,7 @@ not x | if x is false, then True, else False | (3) False ``` ### `and`: -`` +``` >>> True and False # Second argument is evaluated. False >>> False and True # Short-circuted at first argument. @@ -47,6 +47,17 @@ not x | if x is false, then True, else False | (3) True ``` +## How python sees True and False + +For python `True==1` and `False==0` + +```python +1 and False //False +0 and 1 //False +1 and True //True +1 or 0 //True +``` + ## Other boolean-operations: These are other boolean operations which are not part of the Python language, you will have to define them yourself or use the boolean expression within the parenteses. @@ -202,3 +213,4 @@ xnor ( not (x or y) or (x and y) ) | | False >>> not(not(False or False) or (False and False)) # Second argument is evaluated. True +``` \ No newline at end of file