Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Hidden features of Python. Parent comment
You can check if two out of three are true with
(bool1 + bool2 + bool3) >= 2
You can do
count_negatives = sum(number < 0 for number in numbers)
There are no comments on this comment yet.
You can check if two out of three are true with
(bool1 + bool2 + bool3) >= 2
You can do
count_negatives = sum(number < 0 for number in numbers)