?:
operator used in C. But by some fortune, I ran across this Python snippet:("False", "True")[var == True]
which does exactly the same as what you would write in C
var ? "True" : "False"
What a relief!
Eric's lab notes gone stellar!
?:
operator used in C. But by some fortune, I ran across this Python snippet:("False", "True")[var == True]
var ? "True" : "False"
No comments:
Post a Comment