Advertisement
Olegos

Склонения для цифр

Feb 19th, 2022
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. def RusEnding(_int) :
  2. f1 = lambda a: (a%100)//10 != 1 and a%10 == 1
  3. f2 = lambda a: (a%100)//10 != 1 and a%10 in [2,3,4]
  4. return "рубль" if f1(_int) else "рубля" if f2(_int) else "рублей"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement