Build a Caesar Cipher - Step 10

Tell us what’s happening:

For the step10, I put this code with indentation but it’s not working :

def caesar():
shift = 5
alphabet = ‘abcdefghijklmnopqrstuvwxyz’
shifted_alphabet = alphabet[shift:] + alphabet[:shift]
translation_table = str.maketrans(alphabet, shifted_alphabet)
text = ‘hello world’
encrypted_text = text.translate(translation_table)

Your code so far


# User Editable Region

def caesar():
    shift = 5
    alphabet = 'abcdefghijklmnopqrstuvwxyz'
    shifted_alphabet = alphabet[shift:] + alphabet[:shift]
    translation_table = str.maketrans(alphabet, shifted_alphabet)
    text = 'hello world'
    encrypted_text = text.translate(translation_table)

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36

Challenge Information:

Build a Caesar Cipher - Step 10

You have changed the seed code. I suggest you reset the step and only do what is asked, don’t change anything else.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.