[OT] Number theory [Was: A use for integer quotients]

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Tue Jul 31 01:29:44 EDT 2001


Mon, 30 Jul 2001 11:43:48 +0300, Moshe Zadka <m at moshez.org> pisze:

> The correct way to write it is:
> 
> print ["There was %d error", "There were %d errors"][n>1] % n

You are right.

> This way, making this application translatable is a piece of cake.

Really? In Polish a different form of "there were" and "errors"
is needed depending on whether
    n%10 in (2,3,4) and (n//10)%10 != 1
or not :-)

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list