Tell us what’s happening:
Please guys how do I solve this problem, I kept getting error messages. Is anyone that can assist. error message
Sorry, your code does not pass. Keep trying.
You should move all the code you wrote so far within the caesar function.
def caesar(message, shift):
alphabet = "abcdefghijklmnopqrstuvwxyz"
shifted_alphabet = alphabet[shift:] + alphabet[:shift]
translation_table = str.maketrans(alphabet, shifted_alphabet)
encrypted_text = message.translate(translation_table)
return encrypted_text
Your code so far
# User Editable Region
def caesar(alphabet, shift):
alphabet = 'abcdefghijklmnopqrstuvwxyz'
shifted_alphabet = alphabet[shift:] + alphabet[:shift]
table = string.maketrans(alphabet, shifted_alphabet)
return plaintext.translate(table)
# User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Challenge Information:
Build a Caesar Cipher - Step 10