Learn String Manipulation by Building a Cipher - Step 71

Tell us what’s happening:

My issue is not solved
new_index = offset * direction but it still not taking it
it is saying to keep on trying for this
please look into it and let me know how can i proceed

Your code so far

text = 'Hello Zaira'
custom_key = 'python'

def vigenere(message, key, direction):
    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)

# User Editable Region

            new_index = offset * direction

# User Editable Region

            encrypted_text += alphabet[new_index]
    
    return encrypted_text
    
#encryption = vigenere(text, custom_key)
#print(encryption)

Your browser information:

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

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 71

Hi. I suggest you reset the step as you have changed the existing code. You need to add to the code that is already there.

If you have problems please update your revised code to t his thread.

Hello there,

You need to multiply offset by direction in the new_index calculation, without any extra parentheses around that operation. Make sure you’re just multiplying the two values and using that result directly.

I hope this helps. :slight_smile:

Thanks but this is the message i am getting even after typing the right code line could you please look into this and let me know what can i do to solve the issue.

In your screenshot, you appear to be on step 70, is that correct?

Because you’ve opened a thread for step 71. This will cause some confusion for everyone.

Read the hint that you’re given:

You should turn the last two lines in your code into comments. Put a # at the beginning of each line.

yeah my bad i am at step 70 can you help me in this please.

please open a topic for step 70 then

how can i do that can you walk me through that?

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge. This button only appears if you have tried to submit an answer at least three times.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

I am not getting the help button only thing i am getting is reset button can you help me in this please.

did you try to submit at least three times?

yeah now how can i solve the issue?

Hi. If you put through the wrong answer 3 times for step 70 then the help button in the picture above will appear. It doesn’t appear the first two times. The forum helps people by having the threads for the correct step.

sorry but i am getting a bit carried away can you please tell me if i am not able to see the help option then how can i go ahead from this step?

the help button is right next to the reset button, you may need to submit a few times for it to appear but it’s there

it creates a template with your code properly formatted, and a link to the step, so if you really can’t, make sure you include those elements in your post

i understood the first paragraph but not getting your point in the second one and yes i can see the help button here but when i click it is asking me to creat a help post on the forum or check if your question has already been answered on the forum which i have already done so now what?

you created a post for asking for help with step 70? I see only this one for step 71

my bad i meant step 70 can you please help me in that?

yes, if you create the topic for it.

Please create the topic for step 70, with your code for step 70

ok i will share it here only in our chatting hope thats ok