Created
June 2, 2022 12:09
-
-
Save mijorus/fea136b45f707a2f50d0c4c4d1af5618 to your computer and use it in GitHub Desktop.
Python ternary operator function shorthand
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
def qq(condition, is_true, is_false): | |
return is_true if condition else is_false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment