Learn String Manipulation by Building a Cipher - Step 88

Tell us what’s happening:

the order is to Delete encryption and the print(encryption) call. Also, comment out the last two lines of your code.
and i couldn’t pass it

Your code so far


# User Editable Region

text = 'Hello Zaira!'
custom_key = 'python'

def vigenere(message, key, direction):
    key_index = 0
    alphabet = 'abcdefghijklmnopqrstuvwxyz'
    translated_text = ''

    for char in message.lower():
        if not char.isalpha():
            translated_text += char
        else:
            key_char = key[key_index % len(key)]
            key_index += 1
            offset = alphabet.index(key_char)
            index = alphabet.find(char)
            new_index = (index + (offset * direction)) % len(alphabet)
            translated_text += alphabet[new_index]

    return translated_text

def encrypt(message, key):
    return vigenere(message, key, 1)

def decrypt(message, key):
    return vigenere(encryption, key, -1)

#decryption = decrypt(encryption, custom_key)
#print('plain text:', text)
#print('decrypted text:', decryption)

# 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/131.0.0.0 Safari/537.36

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 88

Here is the original 4 lines of code:

encryption = encrypt(text, custom_key)
print(encryption)
decryption = decrypt(encryption, custom_key)
print(decryption)

You have deleted encryption and the print(encryption) call :white_check_mark:

decryption = decrypt(encryption, custom_key)
print(decryption)

That should leave 2 lines to comment out, but you have 3 lines commented. They appear to have been edited as well. You may have anticipated future steps? Just do what the instructions as explicitly

where is this from? reset the step, and do the instructions again. You should not add new lines in this step