Skip to content

Instantly share code, notes, and snippets.

@cburmeister
Created March 6, 2014 18:11
Show Gist options
  • Save cburmeister/9395899 to your computer and use it in GitHub Desktop.
Save cburmeister/9395899 to your computer and use it in GitHub Desktop.
TIL Python's booleans are just integers
>>> 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