There was an error while loading. Please reload this page.
1 parent 55813f7 commit c87f60bCopy full SHA for c87f60b
abbreviation/abbreviation.py
@@ -0,0 +1,16 @@
1
+# internationalization - i18n
2
+# foobar - f4r
3
+# it - it
4
+
5
6
+def abbrevation(word):
7
+ if not word or len(word) < 3:
8
+ return word
9
10
+ return word[0] + str(len(word) - 2) + word[-1]
11
12
13
+print(abbrevation('internationalization'))
14
+print(abbrevation('foobar'))
15
+print(abbrevation('it'))
16
+print(abbrevation('a'))
0 commit comments