logoalt Hacker News

hyrix01/22/20253 repliesview on HN

The answer is obviously because programmers want to be able to write

  f”{n} result{‘s’ if n == 1 else ‘’}”

Replies

thfuran01/22/2025

Then they had best steer well clear of Poland.

isodev01/22/2025

Must be the same programmers that make it impossible for me to sign into places with all the diacritics in my name.

remram01/22/2025

> 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)

show 2 replies