spock
11/1/2017 - 6:11 PM

Count conditions met

In Python, not only is 0 False and 1 True, but True is 1 and False is 0. This means you can do weird things like:

>>> a = 1
>>> (a==1) + (a>0) + (a==2)
2