Skip to content

Instantly share code, notes, and snippets.

@mijorus
Created June 2, 2022 12:09
Show Gist options
  • Save mijorus/fea136b45f707a2f50d0c4c4d1af5618 to your computer and use it in GitHub Desktop.
Save mijorus/fea136b45f707a2f50d0c4c4d1af5618 to your computer and use it in GitHub Desktop.
Python ternary operator function shorthand
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