def plural(n, form1, form2, form3): plural = 1 if n % 10 == 1 and n % 100 != 11 else 2 if n % 10 >= 2 and n % 10 <= 4 and n % 100 < 10 or n % 100 >= 20 else 3 return { 1: str(n) + ' ' + form1, 2: str(n) + ' ' + form2, 3: str(n) + ' ' + form3 }[plural]