repl.it
@anonymous/

RevolvingCheapGoa

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
examples = [
1234567,
999500,
999499,
102,
1000,
1001,
100000,
12345678912,
1452815612,
1302378490588
]

def f(n):l=len(str(n))-4;return f"{round(n,~l):,}"[:4].replace(*",.").rstrip('.')+"KMBT"[-~l//3]if n>9999else n

for e in examples:
  print(e, "->", f(e))