Created
April 2, 2022 13:49
-
-
Save pmbrull/b4982cc2cdde107f8015ad55eb1ed656 to your computer and use it in GitHub Desktop.
Python truth 5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The first argument is True | |
coffee = 10 | |
milk = None | |
coffee or milk # 10, milk is not evaluated | |
coffee and milk # None, both expressions are evaluated | |
# The first argument is False | |
coffee = None | |
milk = 5 | |
coffee or milk # 5, both expressions are evaluated | |
coffee and milk # None, milk is not evaluated |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment