Tell us what’s happening:
Holaa, necesito ayuda con el Step 10, de construir un cifrado Cesar, la verdad que no le encuentro la vuelta, me da un error que el codigo no se encuentra dentro del cuerpo de la funcion, o fuera de la sangria, muchas gracias!!
Hi, I need help with Step 10 of building a Caesar cipher. I’m really stuck; I’m getting an error that the code isn’t inside the function body or outside the indentation. Thanks a lot!
Your code so far
def caesar():
print('caesar')
alphabet = 'abcdefghijklmnopqrstuvwxyz'
shift = 5
shifted_alphabet = alphabet[shift:] + alphabet[:shift]
translation_table = str.maketrans(alphabet, shifted_alphabet)
text = 'hello world'
encrypted_text = text.translate(translation_table)
print(encrypted_text)
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Challenge Information:
Build a Caesar Cipher - Step 10