Skip to content

Instantly share code, notes, and snippets.

@john9631
Last active May 3, 2018 05:24
Show Gist options
  • Save john9631/9242ebe895db3e04ca0cf3a5a880a5dd to your computer and use it in GitHub Desktop.
Save john9631/9242ebe895db3e04ca0cf3a5a880a5dd to your computer and use it in GitHub Desktop.
print conditional expression
print(
'string involved' if str in {type(varA), type(varB)} else
'bigger' if varA > varB else
'smaller' if varA < varB else
'equal'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment