Quantcast
Channel: Compact way of writing (a + b == c or a + c == b or b + c == a) - Stack Overflow
Viewing all articles
Browse latest Browse all 17

Compact way of writing (a + b == c or a + c == b or b + c == a)

$
0
0

Is there a more compact or pythonic way to write the boolean expression

a + b == c or a + c == b or b + c == a

I came up with

a + b + c in (2*a, 2*b, 2*c)

but that is a little strange.


Viewing all articles
Browse latest Browse all 17

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>