SHARE
TWEET

Untitled

a guest Apr 30th, 2015 204 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. alphabet = list("abcdefghijklmnopqrstuvwxyz")
  2. rand_chars = "-@#$%^&*()_+-={}|[];:<`>/~"
  3. troll_alphabet = sorted(rand_chars)
  4.  
  5. def trollify(text):
  6.     '''english -> troll language'''
  7.     print("\nTROLL::::\033[91m")
  8.     print(''.join([troll_alphabet[alphabet.index(ch.lower())] if ch != " " and ch in alphabet and ch not in rand_chars else ch for ch in text.lower() if ch not in rand_chars]) + "\033[0m")
  9.  
  10. def englishify(text):
  11.     '''troll language -> english'''
  12.     print("\nENGLISH::::\033[91m")
  13.     print( ''.join([alphabet[troll_alphabet.index(ch)] if ch in troll_alphabet else ch for ch in text]) + "\033[0m")
  14.  
  15. to_do = input("enter 1 to translate english -> troll \nenter 2 to translate troll -> english:   ")
  16. if to_do != "1" and to_do != "2":
  17.     print("\nyou did not enter 1 or 2")
  18.     exit()
  19. text = input("\nenter text to translate:\n")
  20. if to_do == "1":
  21.     trollify(text)
  22. if to_do == "2":
  23.     englishify(text)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top