Skip to content

Instantly share code, notes, and snippets.

@ipconfiger
Created April 28, 2013 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ipconfiger/062836b91407e13f98b8 to your computer and use it in GitHub Desktop.
Save ipconfiger/062836b91407e13f98b8 to your computer and use it in GitHub Desktop.
import random
s = "wkjkjd fsk fsdjk bbb sss fasdf"
def insert(s):
if not s:
return "a"
idx = random.randint(0,len(s)-1)
return "".join([s[0:idx],"a",s[idx:len(s)]])
result = " ".join(["".join([word[0],insert(word[1:-1]),word[-1]]) for word in s.split()])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment