Build a Caesar Cipher - Step 25

Tell us what’s happening:

I really don’t understand why “You should assign Pbhentr vf sbhaq va hayvxryl cynprf. to encrypted_text.”

Your code so far

def caesar(text, shift, encrypt=True):

    if not isinstance(shift, int):
        return 'Shift must be an integer value.'

    if shift < 1 or shift > 25:
        return 'Shift must be an integer between 1 and 25.'

    alphabet = 'abcdefghijklmnopqrstuvwxyz'

    if not encrypt:
        shift = - shift
    
    shifted_alphabet = alphabet[shift:] + alphabet[:shift]
    translation_table = str.maketrans(alphabet + alphabet.upper(), shifted_alphabet + shifted_alphabet.upper())
    encrypted_text = text.translate(translation_table)
    return encrypted_text

def encrypt(text, shift):
    return caesar(text, shift)
    

# User Editable Region

def decrypt(text, shift):
    return caesar(text, shift, encrypt=False)


# User Editable Region

encrypted_text = encrypt('Pbhentr vf sbhaq va hayvxryl cynprf.', 3)
print(encrypted_text)

decrypted_text = decrypt(encrypted_text, 13)
print(decrypted_text)

# User Editable Region

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.6478.251 Safari/537.36 UOS Professional

Challenge Information:

Build a Caesar Cipher - Step 25

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-caesar-cipher/681a44f4c3235f7d8f428545.md at main · freeCodeCamp/freeCodeCamp · GitHub

you are assining a call to encrypt, instead you need to assign the encrypted text directly

note you are not asked to keep the function call, but to change completely what is assigned to encrypted_text

I got it, thx so much. Have a nice day!!!