PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import string
import random
def text():
'''
If you are coming from Java world, you might already have heard about the method overloading in Java. Kotlin, with the help of default parameters and named arguments helps us to reduce the number of overloads that we generally need in Java world.
'''
def codeAWord(word):
printables = string .ascii_letters
if (word[-1] in printables):
offset = -1
else:
offset = -2
length = len(word)-1-offset
pre = word[0]
middle = list(word[1:offset])
random.shuffle(middle)
post = word[offset::]
return pre+"".join(middle)+post
text = text.__doc__
myList = text.split()
#print(text)
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run