Created
August 28, 2018 19:47
-
-
Save nara-l/2dcd9c569d0ca484a64db24d0c38e6ea to your computer and use it in GitHub Desktop.
Tenary Operator Python 2.7 ( since 2.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
# tenary opeartor | |
foo = test? True: False | |
# python equivalent with if else on same line | |
foo = "True" if test else "False" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment