Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 1337 translator
- # Take a string and convert it into 1337
- # Code by Paul Spooner
- # Released to the public domain
- from random import choice
- #Uber leet?
- #0 to use some normal characters
- #1 for all |337 ones
- UL = 0
- leetChars = {}
- leetChars["o"] = ("O","0","()","*")
- leetChars["i"] = ("I","1","!","|")
- leetChars["z"] = ("Z","2",)
- leetChars["e"] = ("E","3",)
- leetChars["a"] = ("A","4","^","@")
- leetChars["s"] = ("S","5","z","$")
- leetChars["q"] = ("Q","6","9")
- leetChars["d"] = ("D","6",)
- leetChars["t"] = ("T","7","+",)
- leetChars["b"] = ("B","8","6","&",)
- leetChars["p"] = ("P","9","?")
- leetChars["w"] = ("W",r"\/\/",)
- leetChars["x"] = ("X",r"><",)
- leetChars["h"] = ("H","|-|",)
- leetChars["n"] = ("N",r"|\|",)
- leetChars["c"] = ("C","[","(",)
- leetChars["k"] = ("K","X",r"|<",)
- leetChars["v"] = ("V",r"\/",)
- leetChars["m"] = ("M",r"|\/|","^^",)
- leetChars["l"] = ("L","|","|_",)
- leetChars["f"] = ("F","|=",)
- leetChars["y"] = ("Y","7","J")
- leetChars["u"] = ("U","|_|","O")
- leetChars["g"] = ("G","9",)
- leetChars["j"] = ("J","5","!")
- def leet(s):
- old_string = s.lower()
- old_words = old_string.split()
- new_words = []
- for word in old_words:
- for char, leetz in leetChars.items():
- leetchoice = choice(leetz[UL:])
- word = word.replace(char, leetchoice)
- new_words += [word]
- new_string = " ".join(new_words)
- print(new_string)
- #return new_string
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement