-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02_to_hacker_language.py
More file actions
57 lines (51 loc) · 1.31 KB
/
02_to_hacker_language.py
File metadata and controls
57 lines (51 loc) · 1.31 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
## Ejercicio Resuelto por Xouse
#* Escribe un programa que reciba un texto y transforme lenguaje natural a
#* "lenguaje hacker" (conocido realmente como "leet" o "1337"). Este lenguaje
#* se caracteriza por sustituir caracteres alfanuméricos.
#* - Utiliza esta tabla (https://www.gamehouse.com/blog/leet-speak-cheat-sheet/)
#* con el alfabeto y los números en "leet".
#* (Usa la primera opción de cada transformación. Por ejemplo "4" para la "a")
#Se declara una colección con el alfabeto y los numeros
alphabet = {
"a": "4",
"b": "|3",
"c": "[",
"d": ")",
"e": "3",
"f": "|=",
"g": "&",
"h": "#",
"i": "1",
"j": ",_|",
"k": ">|",
"l": "1",
"m": "/\\/\\",
"n": "^/",
"o": "0",
"p": "|*",
"q": "(_,)",
"r": "I2",
"s": "5",
"t": "7",
"u": "(_)",
"v": "\\/",
"w": "\\/\\/",
"x": "><",
"y": "j",
"z": "2",
"0": "o",
"1": "L",
"2": "R",
"3": "E",
"4": "A",
"5": "S",
"6": "b",
"7": "T",
"8": "B",
"9": "g",
}
word = "Keys4Dev"
def valor(caracter):
return alphabet[caracter.lower()]
leet = "".join(list(map(valor, word)))
print(leet)