# Learn String Manipulation by Building a Cipher - Step 75

### Tell us what’s happening:

I think the questions on the forums are outdated. it now asks me to write 2 comments second comment: (encode/decode) and third comment: (encrypt/decrypt) . and everytime i try to do something it kept saying “Find the right key to encode/decode”

``````
# User Editable Region

text = 'Hello Zaira'
custom_key = 'python'

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

for char in message.lower():

# Append space to the message
if char == ' ':
final_message += char
else:
# Find the right key character to encode
key_char = key[key_index % len(key)]
key_index += 1

# Define the offset and the encrypted letter
offset = alphabet.index(key_char)
index = alphabet.find(char)
new_index = (index + offset*direction) % len(alphabet)
final_message += alphabet[new_index]

return final_message
#encode
encryption = vigenere(text, custom_key, 1)
#encrypted
print(encryption)
#decode
decryption = vigenere(encryption, custom_key, -1)
#decrypted
print(decryption)

# User Editable Region

``````

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36`

### Challenge Information:

Learn String Manipulation by Building a Cipher - Step 75

reset the step, these are the two comments to change, you don’t need to create new comments

The python curriculum is still in beta.
That means there will be changes.
that is why older questions on the forum might look different from what is currently live on the site

@ilenia i tried, but it still doesn’t work

``````            # encode/decode
key_char = key[key_index % len(key)]
key_index += 1

# encrypted/decrypted
offset = alphabet.index(key_char)
index = alphabet.find(char)
new_index = (index + offset*direction) % len(alphabet)
final_message += alphabet[new_index]

return final_message
``````

You don’t have to delete the entire comments, just change `encode` into `encode/decode` and `encrypted` into `encrypted/decrypted`

thanks! i finally understood what it meant!

``````solution code removed
``````

It is great that you solved the challenge, but please don’t post your full working solution.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.