Build a Caesar Cipher - Step 8

Tell us what’s happening:

My code on the last line has a lot of errors. I need help fixing them. Can anyone help me?

Your code so far

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

# User Editable Region

encrypted_text = str.translate(translation_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/146.0.0.0 Safari/537.36

Challenge Information:

Build a Caesar Cipher - Step 8

1 Like

try adjusting the variable encrypted_text to call the variable you have assigned to the string you want to be translated via the translation table. When you use str it doesnt know what you want to translate.

1 Like

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