News for hackers. Stuff that matters.
Re:Why is zero plural? (2024) by remram on Tuesday January 21, 2025 @09:34PM (#42788229)
> f"{n} result{'s' if n == 1 else ''}"

n>1 is even shorter than n!=1

(also you wrote == instead of != your code is backwards)

Re:Why is zero plural? (2024) by antiframe on Tuesday January 21, 2025 @10:00PM (#42788432)
But the whole point is that "0 result" is not correct but "0 results" is.
Re:Why is zero plural? (2024) by remram on Friday January 24, 2025 @10:21AM (#42813927)
The question is why is "0 results" correct. hyrix's answer is so that you have a simple equation for plural, my response is that if "0 result" was correct we would have an even simpler equation.
Re:Why is zero plural? (2024) by DonHopkins on Wednesday January 22, 2025 @01:06AM (#42789561)
That makes -infinity ... -1 singular too.