Tell us what’s happening:
I’m to test the caesar function by calling it with the string ‘freeCodeCamp’ and the number 3 as the arguments, assigned the function call to variable encrypted_text
encrypted_text must be global scope; caesar(‘freeCodeCamp’, 3) must be assigned to the encrypted_text variable.
I’ve tried googling a 100 different ways, searched through every lesson trying to find the solution, but the wording must be throwing me off, I don’t understand how to fix. Would appreciate any and all help.
Your code so far
encrypted_text = ('freeCodeCamp', 3)
def caesar(text, shift): #no change from s11
global encrypted_text
alphabet = 'abcdefghijklmnopqrstuvwxyz' #no change from s11
shifted_alphabet = alphabet[shift:] + alphabet[:shift] #no change from s11
translation_table = str.maketrans(alphabet, shifted_alphabet) #no change from s11
encrypted_text = caesar('freeCodeCamp', 3) #changed from
# text.translate(translation_table)
return encrypted_text #no change from s11
# User Editable Region
# placing encrypted_text = caesar('freeCodeCamp', 3) does
# nothing, if put on line 7 or leave 7 alone and put on line 10
# it still gives the same error saying "You should assign
# caesar('freeCodeCamp', 3) to the encrypted_text variable."
# 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/144.0.0.0 Safari/537.36
Challenge Information:
Build a Caesar Cipher - Step 12