Created
March 6, 2014 18:11
-
-
Save cburmeister/9395899 to your computer and use it in GitHub Desktop.
TIL Python's booleans are just integers
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
>>> bool_to_word = ['nope', 'yep'] | |
>>> bool_to_word[True] | |
'yep' | |
>>> bool_to_word[False] | |
'nope' | |
>>> 5 * True | |
5 | |
>>> 5 * False | |
0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment