4 ms·
The answer is obviously because programmers want to be able to write f”{n} result{‘s’ if n == 1 else ‘’}”
by hyrix 2y ago
The answer is obviously because programmers want to be able to write
f”{n} result{‘s’ if n == 1 else ‘’}”
- remram 2y ago> 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)
- antiframe 2y agoBut the whole point is that "0 result" is not correct but "0 results" is.
- remram 2y agoThe 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.
- DonHopkins 2y agoThat makes -infinity ... -1 singular too.
- thfuran 2y agoThen they had best steer well clear of Poland.
- isodev 2y agoMust be the same programmers that make it impossible for me to sign into places with all the diacritics in my name.