Tell us what’s happening:
I am on step 10 of build a caesar cipher using python. The instructions say to 'move all the code I have written so far within the caesar function body’. I have tried writing
def caesar():
alphabet
shift
shifted_alphabet
translation_table
But something is missing - could it be some kind of command that connects the variables together? Or a command in the ‘def caesar():’ heading?
Your code so far
# User Editable Region
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)
def caesar():
(alphabet)
(shift)
(shifted_alphabet)
(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/141.0.0.0 Safari/537.36
Challenge Information:
Build a Caesar Cipher - Step 10