estoy haciendo un encriptor personalizado cambiando una letra del abecedario por otra con .replace()
, funciona perfecto el abecedario y me imprime lo que debe ser pero los numeros no, como lo puedo solucionar?
def encriptar(palabra):
x1 = palabra.replace("a", "m")
x2 = x1.replace("b", "k")
x3 = x2.replace("c", "w")
x4 = x3.replace("d", "a")
x5 = x4.replace("e", "y")
x6 = x5.replace("f", "x")
x7 = x6.replace("g", "h")
x8 = x7.replace("h", "p")
x9 = x8.replace("i", "q")
x10 = x9.replace("j", "f")
x11 = x10.replace("k", "s")
x12 = x11.replace("l", "d")
x13 = x12.replace("m", "j")
x14 = x13.replace("n", "t")
x15 = x14.replace("o", "v")
x16 = x15.replace("p", "r")
x17 = x16.replace("q", "f")
x18 = x17.replace("r", "u")
x19 = x18.replace("s", "o")
x20 = x19.replace("t", "i")
x21 = x20.replace("u", "e")
x22 = x21.replace("v", "g")
x23 = x22.replace("w", "c")
x24 = x23.replace("x", "n")
x25 = x24.replace("y", "l")
x26 = x25.replace("z", "b")
#numeros
x27 = x26.replace("0", "3")
x28 = x27.replace("1", "7")
x29 = x28.replace("2", "9")
x30 = x29.replace("3", "0")
x31 = x30.replace("4", "2")
x32 = x31.replace("5", "8")
x33 = x32.replace("6", "5")
x34 = x33.replace("7", "1")
x35 = x34.replace("8", "4")
x36 = x35.replace("9", "6")
print(x36)
def desencriptar():
pass
encriptar("1234567890")
1602451460
. ¿Cual debiera ser el resultado correcto? Edita tu pregunta y agrega esa información.