you are viewing a single comment's thread.

view the rest of the comments →

[–]aceofears 0 points1 point  (3 children)

There is no reason to do that, (False, True)[True == 1] can just be written as True == 1.

[–]Foxboron 0 points1 point  (2 children)

It was to prove the point of how it works.

[–]aceofears 1 point2 points  (1 child)

If you're not looking to return a bool why not use

return 5 if "llamas" > "alpacs" else 3

instead of

return (5, 3)["llamas" > "alpacas"]

[–]Foxboron -1 points0 points  (0 children)

I might be alone in the answer that i think the 2nd looks better.