Learn String Manipulation by Building a Cipher - Step 67

Tell us what’s happening:

it is telling me to add a ‘pass’ bc of indentation error and i am not sure where to put the ‘pass’

Your code so far

text = 'Hello Zaira'
custom_key = 'python'

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

    for char in message.lower():
    
        # Append space to the message
        if char == ' ':
            encrypted_text += 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) % len(alphabet)
            encrypted_text += alphabet[new_index]
    
    return encrypted_text

# User Editable Region

        encryption = (text,custom_key):
            pass

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

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 67

That message is telling you that you may need to add pass but this is not the case. First of all, start this line with the right indentation (no indentation at all).
Then, to assign the value return by a function call to a variable use the following syntax:
variable = function_name(arg1, arg2)

Hi there. For this challenge, you’re supposed to call the vigenere function you’ve been creating for the past several challenges. The vigenere function takes some text and a custom key as arguments.

That being said, you seem to have confused the editor. You’re not supposed to add a colon after the function call. Plus your indentation seems off. Maybe trying pushing the lines of code to the left should help.

Happy coding. :slight_smile:

Frist remove your :and pass.
Then add vigenere to your encryption
example

example = example(1, 2)
1 Like